为什么在EXEC PHP中运行NOHUP时,为什么要更新NOHUP.OUT
我正在运行PHP插座。我通过NOHUP运行该程序。通过根正确运行此程序。但是我的问题是通过php中的exec()
函数运行程序。当我以这种方式运行命令时,程序可以正确运行,但程序输出未在NOHUP.OUT中打印。
我在SSH中的命令: nohup php my_path/example.php&
#
在用户php中工作我的命令: exec('nohup php my_path/example.php>/dev/null 2>&&'',$ output);
#not Update nohup.out
请指导我...
I'm running a php socket. I run the program through nohup. Run this program properly through root. But my problem is running the program via the exec ()
function in php. When I run the command this way the program runs correctly but the program output is not printed in nohup.out.
my command in ssh:nohup php my_path/example.php &
#is working
my command in user php:exec('nohup php my_path/example.php >/dev/null 2>&1 &', $output);
#not update nohup.out
please guide me...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
来自
exec
上的 PHP 文档:来自
man nohup
:为了满足两者 - 手动重定向到
nohup.out
:From PHP docs on
exec
:From
man nohup
:To satisfy both - redirect manually to
nohup.out
: