php error reporting - having trouble matching local & web server settings

Posted by Andrew Heath on Stack Overflow See other posts from Stack Overflow or by Andrew Heath
Published on 2011-01-29T07:00:07Z Indexed on 2011/01/29 7:26 UTC
Read the original article Hit count: 220

Filed under:
|
|

I'm trying to add a custom error handler to my site, but in doing so have discovered that my webhost's PHP error reporting settings and those of my localhost (default XAMPP) vary considerably.

While I thought I was programming to E_STRICT like a good little boy, adding the error handler to my webhost revealed craploads of Runtime Notices. Example:

Runtime notice
strtotime() [function.strtotime]: It is not safe to rely on the system's timezone
settings. Please use the date.timezone setting, the TZ environment variable or 
the date_default_timezone_set() function. In case you used any of those methods
and you are still getting this warning, you most likely misspelled the
timezone identifier. We selected 'America/Chicago' for 'CST/-6.0/no DST' instead
In /home/...

Clearly this isn't a red-alert, showstopping error. But what bothers me is that it doesn't show up on my localhost. I'd certainly like to improve my code by addressing these sorts of issues if I could see them!

I've looked through both php.ini files, and my webhost's setting is error_reporting = E_ALL & ~E_NOTICE whereas mine was error_reporting = E_STRICT, which I had thought was better. However, changing mine to match and rebooting the server doesn't seem to have accomplished anything.

Could someone please point me in the right direction?

© Stack Overflow or respective owner

Related posts about php

Related posts about error