简体   繁体   English

执行PHP CGI脚本作为后台进程?

[英]Execute a PHP CGI script as a background process?

我可以使用exec()将PHP CGI脚本作为后台进程运行吗?

You could try it to start it as an linux background process using exec(). 您可以尝试使用exec()将其作为linux后台进程启动。

You could try this: 您可以尝试以下方法:

exec('/usr/bin/php /path/to/your/script.php &') ; exec('/usr/bin/php /path/to/your/script.php &') ;

The '&' tell's linux to start this command in the background. “&”告诉Linux在后台启动此命令。

Note: You lose control over your executed script at that point and it may not work with all hosts (especially shared host envoirements). 注意:此时您将失去对已执行脚本的控制,它可能不适用于所有主机(尤其是共享主机环境)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM