php execute a background process

前端 未结 19 1502
萌比男神i
萌比男神i 2020-11-21 07:04

I need to execute a directory copy upon a user action, but the directories are quite large, so I would like to be able to perform such an action without the user being aware

19条回答
  •  Happy的楠姐
    2020-11-21 07:32

    You might want to try to append this to your command

    >/dev/null 2>/dev/null &
    

    eg.

    shell_exec('service named reload >/dev/null 2>/dev/null &');
    

提交回复
热议问题