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?
-  1You havent mentioned what kind of operating system you're running apache on. Check your apache config for the location of logfiles.pauska– pauska2011-03-22 22:59:33 +00:00Commented Mar 22, 2011 at 22:59
-  I am using Ubuntu OS.Genadinik– Genadinik2011-03-22 23:01:22 +00:00Commented Mar 22, 2011 at 23:01
-  Which is the file that should contain this information by the way? - Thanks!Genadinik– Genadinik2011-03-22 23:02:28 +00:00Commented Mar 22, 2011 at 23:02
  Add a comment   |    
 2 Answers
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/
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
-  Would be useful to many more - if you could mention where to add the lines 1 and 2vishva8kumara– vishva8kumara2020-08-08 09:24:30 +00:00Commented Aug 8, 2020 at 9:24
-  1#1 and #2 can be configured in several places: In php.ini (global config) or an apache virtualhost block (per website config)... or at runtime with ini_set(). That is probably why the author of this answer did not get into that particular subject.Jette– Jette2020-11-02 09:25:12 +00:00Commented Nov 2, 2020 at 9:25