I want to run python script from php. I am on python 3.5 , 64 bit .I have read StackQ1 and StackQ2. No one was helpful. I am running this code
<?php $py = exec("D:/pythonFolder/python C:/wamp64/www/python.py"); echo $py; ?> D:/pythonFolder/python is the path to python.exe. On running the above code, nothing happens. I also tried with this $py = shell_exec("python C:/wamp64/www/python.py"); and this $py = exec("python C:/wamp64/www/python.py"); but no success. Any help will be appreciative.
$outputparameter toexecto check what is emitted.$pyis already a output parameter.lson a Windows machine? And you're usingexec()function wrongD:/pythonFolder/python C:/wamp64/www/python.pyif it's working correctly on cmd?? Also$pywill only have The last line from the result of the command. , you may want to check that as well.