php.ini - errors not being thrown

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi guys,

I'm somewhat new to PHP, so please excuse what I hope is an easy

I've experienced some issues lately where the code on my development
environment throws no errors, but when I upload to a shared hosting
server errors are thrown.

The latest was when I had output before calling header(); which should
normally throw an error. As mentioned above, this threw no errors on
my local machine but did only when I uploaded to another server.

My setup is:
 - PHP 5.2.5
 - Windows XP
 - Apache

The following is from my php.ini:
 - display_errors:On
 - error_reporting:8191

I also have error_reporting(E_ALL | E_STRICT); in my project.

Can anyone please let me know what you would run in production in
terms of exception throwing?



Re: php.ini - errors not being thrown

Michael Sharman wrote:
Quoted text here. Click to load it

To start with, is this the syntax you have in your php.ini file?  It
should be:


Next, are you sure this is the php.ini file you're using?  What does
phpinfo() show for these settings and the php.ini file being used?

Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.

Re: php.ini - errors not being thrown

Quoted text here. Click to load it
Hi Jerry,

Thanks for your response. I have the following in my php.ini:

error_reporting  =  E_ALL | E_STRICT
display_errors = On

The "Loaded Configuration File" is "C:\Program Files\PHP\php.ini"

phpinfo(); is showing:
 - display_errors:On
 - error_reporting:8191


Re: php.ini - errors not being thrown


Quoted text here. Click to load it

This could have something to do with output buffering locally and not on  
production? Or something like implicit_flush...

Quoted text here. Click to load it

Production would be run in E_ALL, with display_errors of and log_errors to  
a file of your choice.

Some starters for hunting the reason down:
1) Compare the phpinfo() output of your develelopment & production server.  
Any noticable differences?

2) Are you sure this is not because differences unrelated to code  
directly? (like file permissions, installed extentions, database user  
permissions etc.)

3) Is the error not shown, or simple not being thrown? Trigger_error()  
should tell you wether deliberate errors make it to your screen. For good  
measure, add a trigger_error() just after a point your production  
environment throws an error, so run-time settings are more or less as  
identical as you can get them. If it's just that the error doesn't exist,  
I refer you to option (2) )

4) Any particular errors / common themes about the errors thrown?

5) Is there a difference in PHP versions between development & production?

6) Any calls set_error_handler() / set_exception_handler() anywhere in the  
Rik Wasmus
...spamrun finished

Site Timeline