nohup: run PHP process in background

余生颓废 提交于 2019-11-29 04:29:53

The PHP CLI environment can be different from the web environment (mod_php, FCGI, whatever). It's entirely possible for a script to die with an error when run from the commandline and not when you invoke it through a webserver. Debug your script. If you can, SSH into your server, su to the webserver user and run the script from the commandline yourself.

If you can't do that, set up your own development server where you can do this (it's not that hard if you know some Linux).

chf

Except possible permission issue, a similar answer is posted here - https://stackoverflow.com/a/22705727/3471333.

nohup /usr/local/bin/php5 /.../../file.php </dev/null 2> /dev/null & echo $!
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!