PHP Setting - Errors

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

PHP Setting - Errors

Post 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.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post 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.
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post 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.
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post 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.
Post Reply