How can I debug exec() problems?

后端 未结 4 777
情深已故
情深已故 2020-11-22 00:47

The exec command doesn\'t work on my server, it does not do anything, I\'ve had safe_mode off, and verified that all the console commands are working, I\'ve tried with absol

4条回答
  •  我在风中等你
    2020-11-22 01:35

    Since you are dropping out of the PHP context into the native shell, you are going to have a lot of issues debugging.

    The best and most foolproof I have used in the past is writing the output of the script to a log file and tailing it during PHP execution.

     ~/debug.log 2>&1");
    

    Then in a separate shell:

    tail -200f ~/debug.log
    

    When you execute your PHP script, your errors and output from your shell call will display in your debug.log file.

提交回复
热议问题