Knowledgebase

HELP: Blank PHP pages, display_errors = On... safe_mode = Off

Posted by ybjp, 09-01-2007, 03:25 PM
I've searched the internet from top to bottom trying to fix this problem! I can't see error message on php pages! In the php.ini file the display_errors is on. safe_mode is off. error_reporting is E_ALL ^ E_NOTICE (meaning all errors except notices, this works I've used it on other LAMP servers.) Here are two files i've created: http://www.ybhosting.com/test.php source code: http://www.ybhosting.com/test2.php The second one does not spit an error message about the character "d". It just results in a blank page. I am using virtual server from media-temple. I've restarted the server several times. Please help! Thanks.

Posted by Steve_Arm, 09-01-2007, 04:02 PM
Displaying php errors is bad. It might expose valuable information to hackers. So I would worry for the opposite. Run this test:

Posted by ThatScriptGuy, 09-01-2007, 04:29 PM
But it's incredibly useful when trying to troubleshoot your own apps.

Posted by tersum, 09-01-2007, 07:30 PM
If you are using mediatemple's dv try tailing the error log: tail -f /var/log/httpd/error_log (if that's where your error log is) If you are using the grid server then I'm sure they provide you with the error log file within the account center.

Posted by ybjp, 09-01-2007, 07:45 PM
Hi Steve, I tried the code stated above. With no luck. Just now, I tried this in the terminal.... This gives me the impression that it's a problem with apache...

Posted by ybjp, 09-01-2007, 07:53 PM
This doesn't display php errors for some reason either. I did however set /var/log/php.log to write out the errors and that doesn't do it either UNTIL I tried it in the terminal! Very weird stuff.

Posted by Bangalore Job Mob, 09-01-2007, 09:04 PM
So write a custom error handler and fix your broken code.

Posted by ybjp, 09-01-2007, 09:32 PM
RESOLVED! I made a big mess of things. got rid of the .htaccess php_flag that i had. that was messing everything up. E_ALL ^ E_NOTICE only works in PHP 5.... this server is running PHP 4. This is the first time i deal with virtual hosting and plesk. Use this instead: error_reporting = E_ALL & ~E_NOTICE thanks everyone for all your help!

Posted by digirave, 09-02-2007, 12:50 AM
error_reporting = E_ALL & ~E_NOTICE is the easy way, but you really should learn how to go through logs as mentioned above tail -f /var/log/httpd/error_log (if that's where your error log is)

Posted by Digit_Canada, 02-02-2010, 10:51 PM
I had the same problem today, with the blank page. Solved it by parsing all my modifited php using the command line php with the -l switch. It found the syntax error and solved my problem. Hope this prevents someone else to spend half a day lookging for a syntax error.



Was this answer helpful?

Add to Favourites Add to Favourites

Print this Article Print this Article

Also Read
Squid and REMOTE_ADDR (Views: 578)


Language:

Client Login

Email

Password

Remember Me

Search