I am trying to execute a python script via PHP. For some reason it doesn't execute. I have included the first line on my python code below:
#!/usr/bin/env python
Here is my PHP code that is executing this code (this is in index.php. test.py is in the same folder as this.):
if(isset($_GET["on"])){
$command = escapeshellcmd("python test.py");
shell_exec($command);
echo "success";
}
But when I click the button to execute the script, I get "success" but the script doesn't execute. Any ideas why?