Apache error log with PHP errors
I just set up PHP and Apache and would like to find where the errors are going. What is the default path of the error logs in apache for PHP?
Solution 1:
There are the locations in these popular operating systems:
RHEL / Red Hat / CentOS / Fedora Linux Apache error file location - /var/log/httpd/error_log
Debian / Ubuntu Linux Apache error log file location - /var/log/apache2/error.log
FreeBSD Apache error log file location - /var/log/httpd-error.log
The detailed answer about the Apache log files is here: http://www.cyberciti.biz/faq/apache-logs/
Solution 2:
Try this:
- error_reporting = E_ALL | E_STRICT
- error_log = /var/log/php_errors.log
- Create log file manually
touch /var/log/php_errors.log chown www-data: /var/log/php_errors.log chmod +rw /var/log/php_errors.log
Now you can view PHP errors by this way
tail /var/log/php_errors.log