PHP CLI won't log errors

bcmcfc picture bcmcfc · Jun 17, 2011 · Viewed 83.5k times · Source

PHP currently will not log errors produced from the command line.

I have :

log_errors = On
error_log = /var/log/php_errors.log

in /etc/php5/cli/php.ini

Am I missing a further setting to get this working?

Answer

George Cummins picture George Cummins · Jun 17, 2011

Please check that the user account running PHP CLI has write access to /var/log/php_errors.log.

Additionally, you can verify that you are using the correct php.ini file like this:

php -a -c /etc/php5/cli/php.ini