Php error log not working

He worked for centuries and stopped. I have to miss something obvious so that complexity can arise.

/etc/php5/apache2/php.ini appropriate settings:

display_errors = On (not sure if this makes a difference) log_errors = On error_log = "/var/www/error_log.log" 

In my code, I have:

 echo 'About to log'; error_log('An error'); 

I see About logging in to the page, but nothing in the error log. Any ideas?

+8
php apache error-log
source share
3 answers

Have you restarted the web server? Until you do php.ini changes will not be considered.

In addition, if you want to track PHP errors, you need to have track_errors=On and error_reporting=E_ALL , although this is not related to error_log calls. Also ensure that the error log file is writable by the web server user.

+11
source share

Ultimately, these were issues of resolution. The file became too large to open it quickly, so I deleted and updated it, but with read-only permissions.

I completely forgot that I removed it, what a pain.

+9
source share

A second entry for error_log appeared in my php.ini file (default is Xampp), overriding the one I installed. Therefore, if other answers do not work for you, repeat the search for several entries of the necessary settings.

+1
source share

All Articles