I am trying to run a simple python script (name.py):
#!/usr/bin/env python
name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
with the following bash script(Helloworld.sh):
#!/bin/bash
python name.py
through the following php
<!DOCTYPE html>
<html>
<body>
<?php
if (isset($_POST['Submit1'])) {
echo shell_exec('sh /home/administrator/Desktop/Helloworld.sh');
}
?>
<form action="myfilename.php" method="post">
<p><Input Type = "Submit" Name ="Submit1" Value = "Save Parameters">
</form>
</p>
</body>
</html>
The error in the log is:
python: can't open file 'name.py': [Errno 2] No such file or directory
The bash file works fine from the terminal. What should I do?
echo shell_exec('python /home/administrator/Desktop/name.py');?