Domanda

In my nginx/php-fpm configuration, not all php errors are recording when they occur.

I've set catch_workers_output = yes in my php-fpm conf (and restarted php-fpm since then).

Some php errors are logging, and some either aren't or are buffering - I'm not sure which (will try to figure out which it is). In the meantime, is there anything else I need to add to a conf file somewhere to make sure all errors get logged immediately? Any ideas for what I might try?

Updated to say: I thought I'd fixed it after following these comments, but still not all errors are logging. Any other ideas?

Update (consolidated): I've narrowed it down to something to do with nginx+emacs. When I 'select all' in emacs and delete, errors won't log again until I restart nginx. When I just delete all the lines with Ctrl+k, errors still delete as expected. Nothing is changing file permissions or ownership. What could be going on?

Thanks :)

È stato utile?

Soluzione

In your FPM Pool Configuration file you can add specific values instead of editing the php.ini file. Here is what I have in my development:

php_flag[display_errors] = on
php_admin_value[error_log] = /vhosts/example.com/logs/php_error_log
php_admin_flag[log_errors] = on

You would normally add these to the end of the file. You may already see a few examples pre-packaged there too.

Don't forget to restart FPM after making the changes of course.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top