I have a CenOS server and i want to enable PHP error logging to a file. I have edited the php.ini file and set
error_log = /var/log/httpd/phperror.log
and also
log_errors = On
I've restarted the apache server with service httpd restart
but still the /var/log/httpd/phperror.log does not get created and no errors are logged. Any idea why?
You can do it by creating an empty file in dir /var/log/httpd/
After creating the empty file, restart the apache server and check it the log file updated with the error log.
It might be a better/easier idea to send the php errors to syslog. You won't have to worry about permission problems and the file should already be rotated.
error_log = syslog
Depending on your OS the errors should then go to /var/log/messages or /var/log/syslog