Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is there any way to disable error logging in php5-fpm?

I changed the /etc/php5/fpm/php.ini file with:

log_errors = Off
display_errors = Off

and restarted php5-fpm.

My nginx logfiles are still full of php warnings.

share|improve this question
    
Did you check that was the ini file used by PHP? –  symcbean May 25 '12 at 9:26
    
I can't find another php.ini file –  user1406271 May 25 '12 at 12:27
1  
Don't search - simply create a page with phpinfo() on it. If you have got the right page, then check you're not overriding the behaviour via http config / .htaccess by adding a page which reports what values it sees using ini_get() –  symcbean May 26 '12 at 11:38
    
Please copy example of the error from the logfile –  GioMac Aug 18 '13 at 14:24

4 Answers 4

Check your php-fpm configuration for:


php_admin_value[error_log] = /var/log/php-fpm/www-error.log
php_admin_flag[log_errors] = on

And comment this out.

share|improve this answer
    
/etc/php5/fpm/php-fpm.conf doesn't contain these lines. –  user1406271 May 25 '12 at 12:13
    
In my instalations there is directory called /etc/php-fpm.d check config files there for those two lines –  B14D3 May 25 '12 at 12:51
    
I don't have this directory. It's something very strange. A few days ago installed php5-fpm+nging on another (dedicated) server and it doesn't log php warnings/errors. Yesterday I installed the same things on VPS and now this problem. Don't know how to solve it. Temporary solution is ini_set('log_errors', 0); –  user1406271 May 25 '12 at 14:47

Edit php-fpm.conf and set error_log= to empty, or /dev/null.

share|improve this answer
    
php-fpm.conf contains the following line error_log = /var/log/php5-fpm.log, but php warnings/errors are logged in /var/log/nginx/error.log –  user1406271 May 25 '12 at 12:21

It's Nginx not php who write this log. You need to edit your nginx config to log only critical error (note that you cannot disable error logging, but you can change the log level). And note that you should fix errors instead of hide them ^^

share|improve this answer

It's Nginx that is logging these errors.

Taken from http://wiki.nginx.org/CoreModule:

Note that error_log off does not disable logging - the log will be written to a file named "off". To disable logging, you may use:

error_log /dev/null crit;

in your nginx.conf file, usually located in /etc/nginx/nginx.conf

share|improve this answer

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.