This is essentially the same as these questions:
https://stackoverflow.com/questions/8677493/php-fpm-doesnt-write-to-error-log
BUT the answers there don't seem to be working on Ubuntu 16.04 with PHP 7.
/etc/php/7.0/fpm/pool.d/www.conf:
catch_workers_output = yes
php_flag[display_errors] = on
php_admin_value[error_log] = /var/log/fpm-php.www.log
php_admin_flag[log_errors] = on
/var/log/fpm-php.www.log
exists and is owned by www-data
.
/etc/php/7.0/fpm/php.ini:
log_errors = On
Nginx Virtual Host's Server block
access_log /var/log/myapp/access.log;
error_log /var/log/myapp/error.log error;
/var/log/myapp/access.log exists and is owned by www-data
.
But when an error occurs, I don't get an error in any of the specified log files, and can't find it in any other place either.
I went through all of the suggestions on the other question but didn't find any answer that worked. I'm assuming something has changed since those answer were posted. Any suggestions?