在php中使用系统执行python脚本时显示错误,在共享主机中显示(显示其他输出)

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.

It's better if you use in PHP:

exec('python test.py', $outp, $return);

You will have at $return the error status returned by the python script (there is an error if is not 0), and the error text at the $outp