I'm executing a python script from php with way,
$mystring = system('python test.py', $retval);
and it works, I just would like to see error messages from the python script. Is it possible? It is returning output, for example, I see a "print "hello"" from the python script, but I dont see errors from the python scripts, it's obviously failing to load a module because execution stops there and I dont see that error displayed.
$mystring = system('python test.py 2>&1', $retval);instead. This mixes stderr and stdout.2>&1comes into play, it tells the system to write all that is intended for file descriptor 2 (the standard error stream out) instead to fd 1 (which is standard output if no one fiddles with it ;-) ). Please try the comment/answer and if it does what you want, enjoy and report back here. Thanks.python test.py 2>&1versus apython test.py 2> /dev/nulland maybe show the python code here in the question?