There are two related questions:
1.
If you use exec, remove disable_functions.
How to ensure safety?
Second, put 1.php and test.py in the same directory
1.php:
<code><?php exec('python test.py'); ?> </code>
test.py:
print '1234'
Call http://localhost/1.php, no response?
There are two related questions:
1.
If you use exec, remove disable_functions.
How to ensure safety?
Second, put 1.php and test.py in the same directory
1.php:
<code><?php exec('python test.py'); ?> </code>
test.py:
print '1234'
Call http://localhost/1.php, no response?
If there is no response when calling python in php, it may be due to an environment variable problem. You can try using the absolute path of python + the absolute path of the python file to call.
If there is no special treatment, the call here may be a synchronous call of http. This place will wait for python to run and may time out.
Try to use exec and other functions in CLI mode
Directly adjust php with python