I want to run a couple of Python scripts from PHP.
On an Ubuntu machine everything looks good right out of the box.
On FreeBSD though I get /usr/local/lib/python2.7: Permission denied
Any idea how to give permissions to Apache to run a Python through shell_exec or exec ?
Also see how I had to name the full path of the Python ?
Is there any way to avoid that too ?
Be sure to use full paths for both python and your script.
$foo = exec('/usr/bin/python /path/script.py'); 
Also, make sure the file permissions where your script is located can be accessed by www, probably will need to chmod 755 /path.
FreeBSD PHP exec permission denied