I am trying to run a python script from php code. I have followed other threads to see what I'm doing wrong, but i can't seem to find the problem.
$out = shell_exec(escapeshellcmd("/path/to/script/here/script.py arg1 arg2"));
echo $out;
As you might ask, yes, the script:
At the same time, any other non-script command works just fine with shell_exec()
I tried your code, it is working fine for me. If there is some error, it must be logged in error.log
file. eg I am using apache so my errors are logged in /var/log/apache2/error.log
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.