I have a simple PHP function that is supposed to execute a Pyton script when its called. I have tried this sort of function multiple times in my php programs, but somehow th
you have to use full path for the python and for your file. you may find the former from the which python command, that most likely outputs '/usr/bin/python' and you should already know the latter. so your command would look like this:
$mystring = exec('/usr/bin/python /home/user/testing.py');
and you should make sure your python script has all appropriate permissions, because your web-server most probably is running as a different user, so permissions should be "-rwxrwxr-x" or something close.