Skip to content Skip to sidebar Skip to footer

Php Exec() And Custom Python Module

* edit * After reinstalling the module, everything worked fine. I have installed a python module on my webserver. When I do 'whereis python' I get following path: python: /usr/bin/

Solution 1:

Should you be doing

exec("/usr/bin/python /usr/lib/python2.4/site-packages/MyModule/myModule script.py -v pixfx.xml 2>&1", $output, $return);

OR

exec("/usr/bin/python/python /usr/lib/python2.4/site-packages/MyModule/myModule script.py -v pixfx.xml 2>&1", $output, $return);

Solution 2:

You might find it useful to debug under the user that php is running under, ie www-data, apache, etc. This is helpful for uncovering any permission, path or environment issues that may arise.

Post a Comment for "Php Exec() And Custom Python Module"