Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running nginx with php-fpm and php 5.3.3. I have in my php.ini config

error_reporting = E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR

Which should turn off all php warnings in the error log but I'm still getting them. How do I get rid of them?

share|improve this question
2  
I'd fix the warnings. I consider them nearly as much a bug as a fatal error would be. – Alister Bulman Jan 3 '11 at 10:39
    
try to fix warning with tools like wordpress.... enjoy ;) – Antony Gibbs May 19 at 18:16

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)

share|improve this answer
    
do php assertion warnings count as errors? – Incognito Jan 3 '11 at 19:46
    
Unlike the regular PHP warnings, the assertion warnings come from your own decision to have PHP to react on a given event. You can control this behavior using the assert_options() call. See tuxradar.com/practicalphp/19/8/3 – ringø Jan 9 '11 at 5:38
    
on most modern unix system '# service php-fpm reload' is the right way to reload configuration – Antony Gibbs May 19 at 18:11
    
be careful with service php-fpm reload on some older ubuntu systems (12.04, not sure about 14.04 yet) as reload causes php-fpm to not work correctly, you can use service php-fpm restart without any problems to php-fpm – codivist May 27 at 21:44

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.

share|improve this answer
    
With the above settings, it still shows warnings in the php-fpm error log file. Seems like it overrides the entry for error_reporting given in the php.ini file. – anup Jun 22 '15 at 6:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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