Where Does The PHP Error Log Reside
Q. Can you tell me exact location for php error log file? I'm running CentOS 5.x server with Apache 2.2 + PHP 5.x server.
A. Generally, on all production web servers displaying error to end users via a web browser is turned off using php.ini file settings. Open /etc/php.ini file and find out line that read as follows:
error_log
error_log defines the name of the file where script errors should be logged. The file should be writable by the web server's user. If the special value syslog is used, the errors are sent to the system logger instead. On Unix, this means syslogd and on Windows NT it means the event log. The system logger is not supported on Windows 95. If this directive is not set, errors are sent to the SAPI error logger. For example, it is an error log in Apache (/var/log/httpd/error_log file) or stderr in command line (CLI)
This line define exact location for each php instance. If error_log set to syslog, open /var/log/messages file to view log. For example if error_log is set to /var/log/apache/php.errors, type the following to display error log:
$ tail -f /var/log/apache/php.errors
$ grep something /var/log/apache/php.errors
$ vi /var/log/apache/php.errors
See also:
Subscribe to our free e-mail newsletter or RSS feed to get all updates.
You can Email this page to a friend.
Related Linux / UNIX FAQ:
- Display or view the perl cgi errors in a web browser
- FreeBSD Find out who is logged in?
- How can I find out who is logged on my UNIX / Linux system?
- Linux remove or clear the last login information
- How to: Run a shell script with nohup command
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Please do not use the comment form to ask for help / question. Ask your question on the excellent Linux tech support forum. Thank you very much for stopping by our site!
Tags: /etc/php.ini, apache php, error_log, exact location, grep command, log messages, php 5, php error log, php.ini, production web servers, tail command, vi command ~ Last updated on: March 13, 2008



Recent Comments
Yesterday ~ 3 Comments
Yesterday ~ 19 Comments
Yesterday ~ 2 Comments
Yesterday ~ 37 Comments
Yesterday ~ 46 Comments