Oliver Nassar

php.ini error_log directive: finally fixed my code to make it work

September 04, 2009

I always ran into an issue whereby if i set the error_log location for an application/server using ini_set('error_log','PATH') it wouldn't log it there. It would log it to whatever path was set in my httpd.conf file, whether it was the global error_log path, or one for a specific virtual host.

I searched high and low on the goog's, but to no avail, I kept running into php.net bug reports about the behaviour not working. Then, I just tried something I should've tried a long time ago, set the write permissions properly (for testing, 777) and gave access to every user on my local machine (eg. on a mac, getinfo on the error log, and make it readable and writable by everyone), and success.

I've had a lot of headaches around this that usually ended up with me giving up, but I finally found a fix for my case of it :)