这个情况分操作系统,linux下可以这样执行命令:
exec('run_baby_run &');
windows下这样执行:
$shell = new COM("WScript.Shell");
$shell->run($command, 0, false);
这样调用就可以实现不阻塞的功能了。
经验来自:
http://stackoverflow.com/questions/3819398/php-exec-command-or-similar-to-not-wait-for-result
http://stackoverflow.com/questions/4197579/nohup-on-windows-exec-without-waiting-for-finish
如您从本文得到了有价值的信息或帮助,请考虑扫描文末的二维码对我进行赞赏和鼓励。
如本文对您有用,您的捐赠和留言将是我最好的支持~
如您愿意,请向更多志同道合的朋友们推荐本站,谢谢。
请尊重他人劳动成果。
转载请务必附上原文链接,我将感激不尽。
有什么问题可以 留言或QQ联系我
我记得可以 exec(‘run_baby_run > null’); 无效吗?没测试.