php exec() function and different hosts

后端 未结 3 1947
时光说笑
时光说笑 2021-01-21 08:20

I have a script that executes a file in a couple of directories down which looks like this:

exec(\"php-cli $file_path > /dev/null 2>/dev/null &\"); //p         


        
3条回答
  •  走了就别回头了
    2021-01-21 09:20

    Simple question perhaps, but does php-cli exist on all the hosts? I assume the reason its failing silently is because you're telling it to be redirecting everything away.

    exec("php $file_path > /some/writable/path/output.log 2>/some/writable/path/error.log &");
    

提交回复
热议问题