PHP built-in server error log location

后端 未结 6 1416
长发绾君心
长发绾君心 2021-01-01 16:17

I don\'t know if there\'s any? but is php built in web server also save its error logs in a file? for tailing purposes, like when creating virtual host in apache.

UP

6条回答
  •  粉色の甜心
    2021-01-01 16:24

    When using PHP builtin server on macOS, you need to specify error_log in your php.ini config file (php -i | grep php.ini).

    If you decide with syslog (instead of a log file) such as:

    error_log = syslog
    

    Then to dump the logs, you can use log command on macOS, e.g.

    log stream --predicate 'processImagePath contains "php"'
    

    Otherwise use some specific file path for the error log (e.g. /usr/local/var/log/php-error.log).

提交回复
热议问题