with nginx with php-fpm, how do i turn off php warnings in the error log of nginx?
Solution 1:
I believe what you need is to modify the pool and add following:
php_admin_value[error_reporting] = E_ALL & ~E_NOTICE & ~E_WARNING & ~E_STRICT & ~E_DEPRECATED
and reload the FPM
sudo service php5.5-fpm restart
replace with whatever version you use.
Solution 2:
Edit your php-fpm pool configuration to specify an alternate path to log to.
An example: You can edit /etc/php-fpm.d/www.conf
and add something like:
php_admin_value[error_log] = /var/log/php-fpm/www-error.log
php_admin_flag[log_errors] = on
Or you can turn logging off, but that's a really bad idea.
Solution 3:
The setting should work.
php-fpm
needs to be restarted as well, not only nginx
.
Also, there are various startup (/etc/init.d/) scripts that do perform the right kill
job when stopping php-fpm
.
Try
ps -ef | grep php
to get the executable name (like php5-fpm
). Then
killall php5-fpm
(or the name you have).
Then start php-fpm again.
Edit 2016 On most modern unix system
# service php-fpm reload
is the right way to reload configuration (Comment from A.Gibbs)