Lampwrights Forum > Linux, Apache, MySQL, PHP > Apache
Register Community Today's Posts Search

Reply
 
Thread Tools
07-18-2010, 08:28 PM   #1
Jeff
Administrator
 
Jeff's Avatar
 
Join Date: Jul 2010
Posts: 402
Rep Power: 10
Jeff is getting browny points
Debugging Blank PHP Screens

In most production environments, the display_errors directive is set to off in the PHP configuration file so when there is a PHP error, the actual error message is not displayed to the user. This is done mostly for security reasons but it can really cause headaches when you are trying to figure out why a page has suddenly stopped working and is only showing your a blank white screen.

If you have access to your Apache error log via a shell (such as SSH or Telnet or a terminal) then you can simply watch the error log with the tail command and see your error as it comes in. This example assumes your path to your error log is /var/log/httpd/error_log:
Code:
tail -f /var/log/httpd/error_log
You could even pass that through a grep filter to see errors caused by your IP address:
Code:
tail -f /var/log/httpd/error_log | grep 123.123.123.123
99% of the time, if it is a PHP error, "tailing" the log will show you the message.
Jeff is offline   Reply With Quote

Reply

Tags

php and apache



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -4. The time now is 05:41 PM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2024, vBulletin Solutions, Inc.