PHP 调用服务器脚本 - 调用后不会继续
是的,我正在 PHP 脚本中调用 Python 脚本。该 PHP 脚本需要在调用 Python 脚本后继续。
我已经尝试了以下所有方法,但 PHP 坚持等待脚本响应。
全部尝试过:-
system('nohup python /home/process/script.py -i '.escapeshellarg($location).' &');
system('nohup python /home/process/script.py -i '.escapeshellarg($location).' 2>&1 &');
system('nohup python /home/process/script.py -i '.escapeshellarg($location).' < /dev/null 2>&1 &');
exec('nohup python /home/process/script.py -i '.escapeshellarg($location).' &');
exec('nohup python /home/process/script.py -i '.escapeshellarg($location).' 2>&1 &');
exec('nohup python /home/process/script.py -i '.escapeshellarg($location).' < /dev/null 2>&1 &');
还尝试过使用 passthru 且不使用 nohup。
非常感谢任何帮助。
Right, I am calling a Python script in a PHP script. This PHP script needs to continue after the Python script has been called.
I have tried all of the following, yet PHP insists on waiting until the script has responded.
All tried:-
system('nohup python /home/process/script.py -i '.escapeshellarg($location).' &');
system('nohup python /home/process/script.py -i '.escapeshellarg($location).' 2>&1 &');
system('nohup python /home/process/script.py -i '.escapeshellarg($location).' < /dev/null 2>&1 &');
exec('nohup python /home/process/script.py -i '.escapeshellarg($location).' &');
exec('nohup python /home/process/script.py -i '.escapeshellarg($location).' 2>&1 &');
exec('nohup python /home/process/script.py -i '.escapeshellarg($location).' < /dev/null 2>&1 &');
Also tried with passthru and without nohup.
Any help greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
引用 exec 文档:
你应该尝试这个:
Quoting the exec doc:
You should try this instead: