Page 1 of 1
Displaying PHP errors without changing the PHP.ini
Posted: Fri Jun 16, 2006 12:24 pm
by Grim...
Hi there.
My host has set 'display_errors = Off' in the php.ini file to my server, so when there is an error, I just get a blank screen.
Is there any way I can get PHP to ignore this?
Posted: Fri Jun 16, 2006 12:31 pm
by Grim...
I can get to my .htaccess file, if that's any use.
Posted: Fri Jun 16, 2006 12:38 pm
by dibyendrah
I think using the following piece of code might resolve your problem.
Code: Select all
ini_set('display_error', 1);
error_reporting(1);

Posted: Fri Jun 16, 2006 12:52 pm
by Grim...
Yeah, but the page won't run if there's a fatal error somewhere...
Posted: Fri Jun 16, 2006 1:08 pm
by RobertGonzalez
Regardless of the display_errors property, your page won't run if there is a fatal error. If you just want to see the errors displayed, use...
Code: Select all
<?php
ini_set('display_errors', 1);
?>
Posted: Fri Jun 16, 2006 2:36 pm
by printf
But that will not work if your using Windows anything in ISAPI/SAPI, because the display errors and log errors can not be changed in memory. So if display errors is off and log errors are on in your php.ini file, you can not make errors show unless you can change the php.ini file!
pif!
Posted: Fri Jun 16, 2006 6:35 pm
by feyd
or something to that effect..