Page 1 of 1
Help - Error messages are turned off!
Posted: Tue Oct 31, 2006 6:06 pm
by zeek
I've been trying to fix a problem for over 2 hours now! The server has error messages turned off (if there's a script error you just get a blank page). I can't fix this without seeing whats wrong. I do not have access to error logs on the server.
Is there a way I can add something to my script to force it to display an error message? It can be sloppy or weird, I just have to FIND OUT WHAT THE ERROR IS! Thanks in advance.
Posted: Tue Oct 31, 2006 6:18 pm
by feyd
error_reporting() and ini_set('display_errors') could be of interest, however that won't catch everything.
If your server runs Apache and allows .htaccess files, you can set the error_reporting and display_errors flags in there, however most errors you should be able to catch on your own testing server (your own machine in many cases.)
Posted: Tue Oct 31, 2006 6:22 pm
by Superman859
I usually stick with the following two settings when working with PHP code. Just add it first thing in your PHP code.
ini_set('display_errors', 1);
error_reporting(E_ALL & ~E_NOTICE);
Thank you
Posted: Tue Oct 31, 2006 6:25 pm
by zeek
Thank you for your quick replies, I'm trying your suggestions now...
IT WORKED!!! Thank you so much.
Posted: Tue Oct 31, 2006 6:26 pm
by feyd
it's advisable to keep notices on if you're allowing errors to display. They can alert you to small errors in your code that suck up execution time for no good reason.