Lampwrights Forum

Lampwrights Forum (http://www.lampwrights.com/index.php)
-   Apache (http://www.lampwrights.com/forumdisplay.php?f=2)
-   -   Debugging Blank PHP Screens (http://www.lampwrights.com/showthread.php?t=3)

Jeff 07-18-2010 08:28 PM

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.


All times are GMT -4. The time now is 07:08 PM.

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