Under Nginx/PHP-FPM, I can't get PHP errors logged to craft/storage/runtime/logs/phperrors.log as they should be.

Initially, errors weren't logging anywhere, but I discovered I needed: catch_workers_output = yes in our PHP-FPM config.

Errors are now logging to /var/log/php7.0-fpm.log, but not to Craft's custom location.


I'm only 80% confident in this answer, but I'm pretty sure that runtime PHP ini_set calls won't work with nginx running with FastCGI (which is what Craft uses to change the error_log path.

Try setting that path directly in your /etc/php5/fpm/php.ini file.

  • After much fussing, figured this out.
    – Tim Kelty
    Aug 11 '16 at 14:43
  • ↑ Seemingly, any value for error_log (or maybe anything?) in /etc/php/7.0/fpm/php-fpm.conf will override even what is set in your pool conf. (e.g. /etc/php/7.0/fpm/pool.d/mysite.conf), .user.ini, and of course runtime ini_set. What I did was comment out the error_log line in /etc/php/7.0/fpm/php-fpm.conf and added php_value[error_log] = ... to Craft's storage path in my pool config. Seems backward...what is especially confusing is looking at phpinfo, the values appear to be overriding, but wont actually work!
    – Tim Kelty
    Aug 11 '16 at 14:49
  • Computers... AMIRITE?!
    – Brad Bell
    Aug 11 '16 at 16:54
  • They're the worst. (╯°□°)╯︵ ┻━┻
    – Tim Kelty
    Aug 12 '16 at 2:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.