Running PHP script from command line as background process

后端 未结 4 1869
时光说笑
时光说笑 2020-12-08 19:14

I\'m trying to run a PHP script continually in the background via the command line in Linux. I have tried the command php filename.php & but it seems like t

4条回答
  •  时光说笑
    2020-12-08 19:56

    nohup /path/to/command-name arg1 arg2 &
    

    Where:
    command-name : name of shell script or command name. You can pass argument to command or a shell script.
    & : nohup does not automatically put the command it runs in the background; you must do that explicitly, by ending the command line with an & symbol.

提交回复
热议问题