PHP calling python not working
Question: I'm having issues getting a python script to run through PHP. I can run my
python script manually with no problems, but cannot run it through PHP. I am
calling the PHP script from a web page that I want to execute a python script.
I have searched all over to try and figure this out, but I can not manage to
get it to work. I have tried exec(), system(), shell_exec(), etc. to run the
script without success. I have also done a chmod +x on the python script. I
have tried things like

    
    
    <?php 
    exec('/usr/bin/python /root/Desktop/ledtest.py');
    ?>
    

Does anyone have any other suggestions?

Edit: I'm trying to give more information but sadly I can't. I just came into
this company as an intern and I'm trying to pick up where the previous intern
left off (it's a huge mess and no one seems to know whats going on here).
Sorry for the lack of information


Answer: What error message you are getting as PHP has some kind of limit, like 30sec,
you may easily find from calling phpinfo() and searching for
max_execution_time in the output. it's possible to change this from the script
to a higher value, if you need, using ini_set('max_execution_time', 1200);,
and you may get another details about max_execution_time from this question:
stackoverflow.com/questions/4220413/…

Additionally,

Whatever error python is raising would be going to the child's stderr. Try
either telling php to read from stderr, or (in python) do this:

import sys sys.stderr = sys.stdout

