Revision 8d52de54-5949-443f-96d4-d9bc3488b2e4 - Stack Overflow

You problem is very common - and in general it's not about executing _python_ scripts - but to execute some _external_ commands. To do that, you'll need some conditions to be fulfilled:

- Normally, PHP is run by web-server. So to execute some script, web-server must be able to do that. It means - that _OS user_, from which web-server was launched, must have enough permissions to execute external command
- In many cases, external execution functions, like [`exec()`][1] or [`system()`][2] are treated as unsafe - and, thus, are disabled in common case (I'm speaking about hostings). So, relying on those functions will make your application's technical requirements more strict - and you'll not be able to use such hostings.

Besides described above, PHP script will "hang" until full data will be passed from `exec()` back to script. That means slow execution and low-predictable response-time. And, more, in Win systems execution of external scripts [is included][3] to total script execution time (unlike in *nix systems) - and, therefore, you may have good chances to catch time limit error if your external script was too long to response.


 [1]: http://us1.php.net/exec
 [2]: http://us1.php.net/system
 [3]: http://us1.php.net/set_time_limit

AltStyle によって変換されたページ (->オリジナル) /