最后如何使用&在后台执行shell命令?我试过:
php -r "shell_exec('sleep 10 &');"和
php -r "shell_exec('/bin/bash -c \"sleep 10 &\"');"在这两种情况下,它都会暂停10秒,而不是只返回shell,然后在后台运行睡眠。
发布于 2014-03-31 15:17:00
你必须把输出改到某个地方。试着做这样的事情:
php -r "shell_exec('sleep 10 > /dev/null &');"https://stackoverflow.com/questions/22765356
复制相似问题