Suppressing output from exec() calls in PHP

后端 未结 4 2131
灰色年华
灰色年华 2020-12-15 17:33

I have a number of command line scripts in PHP that use exec() to perform tasks such as restarting services, loading MySQL timezone files, etc. While exec() itself does not

4条回答
  •  生来不讨喜
    2020-12-15 18:02

    According to http://us3.php.net/manual/en/function.shell-exec.php you can assign this command's output to a variable.

    You don't necessarily have to do anything with the variable, which means you are effectively suppressing output.

    Hope that helps!

提交回复
热议问题