You must run the python script from php. I use the following code
$python = exec('python bla.py'); echo "Python is printing: " . $python; If the python file contains relatively simple code, like print (123) then everything works fine, but if the code is more complex, then if you put print (123) after the import block, the $ python variable is empty? How to understand this?
Unfortunately, the situation does not change. Try writing to bla.py
import requests print(123) This is python 2.7. Output in exec will not be
Problem solved. The code was incorrect, so there was an error. Respectively helped 2> & 1