- php process is wrapped like this: PHP file -> php-fpm -> nginx
- basically means disable all facilities that catch output from the script on it's way to nginx
- standard error output will the end in Nginx's logging facility
On CentOS
- make sure your script does not set
error_log
- edit
/etc/php-fpm.conf
, disable lineerror_log = /var/log/php-fpm/error.log
- edit
/etc/php-fpm.d/www.conf
, disable line starting withphp_admin_value[error_log] = ...
- restart fpm:
systemctl restart php-fpm
- tail
/var/log/nginx/error.log
to see if it worked
On Ubuntu
- pretty much the same, though
php_admin_value[error_log]
seems to be disabled by default
Notes
- long log lines getting truncated in Nginx: http://stackoverflow.com/questions/19084591/php-nginx-error-log-getting-truncated
Thanks for this!