Page 1 of 1

PHP Setting - Errors

Posted: Sun Dec 18, 2005 3:49 pm
by hawleyjr
I need to change a setting in my ini file, i'm just not sure which one.

If I create a page with an error:

Code: Select all

include_once('');//SHOULD THROW ERROR
header('Location: nextpage.php');

or

echo 'my name';
header('Location: nextpage.php');//SHOULD THROW ERROR
On my local server this page will still redirect. However, I want it to throw the error and not redirect.

Posted: Sun Dec 18, 2005 4:22 pm
by Chris Corbyn
error_reporting E_ALL

Are you saying that on another server the scripts dies on error rather than continuing. There's only certain errors that do that.

It'd also work with "or die()" but that'd be tedious.

Posted: Sun Dec 18, 2005 4:24 pm
by hawleyjr
The script dies when I make the header call because the headers were already created.

I really want to keep this at a server level and not a page level.

Posted: Sun Dec 18, 2005 5:03 pm
by hawleyjr
In my INI File:

Code: Select all

error_reporting  =  E_ALL
The following code will throw an error:

Code: Select all

include_once('');//SHOULD THROW ERROR
However, as soon as I add a header call the page moves on.

Code: Select all

include_once('');//SHOULD THROW ERROR
header('Location: nextpage.php');
On my other server the page would not change (header call would not work) because of this errror.