About Linux FAQ

Browse More FAQs:

Where Does The PHP Error Log Reside

Posted by Vivek on Thursday March 13, 08 @6:00 pm

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:

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!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Tags: , , , , , , , , , , , ~ Last updated on: March 13, 2008

Copyright © 2006-2008 nixCraft. All rights reserved - TOS/Disclaimer - Privacy policy - Sitemap - Powered by Open source software.