I am wanting to restart a python script from PHP.
I have created the shell script:
# kill script
`which pkill` -f "$script"
# start script
`which python` "$script" > /dev/null &
when I execute this with www-data (PHP [shell_exec()]) I get the error:
/usr/bin/python: can't open file '
$script': [Errno 13] Permission denied
and the permissions of the '$script' is:
-rwxrwxrwx 1 www-data www-data
The script is not in /var/www and nor do I want it to be.