Search code examples
loggingstdoutphpstderr

How to write PHP errors to stderr?


How can I change php-fpm.conf (or php.ini) so all errors/ warnings/ ... are written to stderr (or alternatively to stdout)?

I run php5-fpm with daemonize = no and want to see all errors in my terminal.


Solution

  • The solution is to set ...

    ; Redirect worker stdout and stderr into main error log. If not set, stdout and
    ; stderr will be redirected to /dev/null according to FastCGI specs.
    ; Note: on highloaded environement, this can cause some delay in the page
    ; process time (several ms).
    ; Default Value: no
    catch_workers_output = yes