470,848 Members | 1,249 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,848 developers. It's quick & easy.

php.ini - errors not being thrown

Hi guys,

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

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?

Thanks,

Michael
Jun 2 '08 #1
3 1410
Michael Sharman wrote:
Hi guys,

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

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?

Thanks,

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

display_errors=on
error_reporting=E_ALL
(or E_ALL | E_STRICT)

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.
js*******@attglobal.net
==================

Jun 2 '08 #2
On May 18, 12:12 am, Jerry Stuckle <jstuck...@attglobal.netwrote:
Michael Sharman wrote:
Hi guys,
I'm somewhat new to PHP, so please excuse what I hope is an easy
question.
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?
Thanks,
Michael

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

display_errors=on
error_reporting=E_ALL
(or E_ALL | E_STRICT)

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.
jstuck...@attglobal.net
==================
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

Michael
Jun 2 '08 #3
On Sat, 17 May 2008 16:00:49 +0200, Michael Sharman <sh****@gmail.com>
wrote:
Hi guys,

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

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.
This could have something to do with output buffering locally and not on
production? Or something like implicit_flush...
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
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
code?
--
Rik Wasmus
....spamrun finished
Jun 2 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Ersin Gençtürk | last post: by
3 posts views Thread by clintonb | last post: by
2 posts views Thread by Anthony Biondo Jr | last post: by
2 posts views Thread by George1776 | last post: by
7 posts views Thread by brett.estabrook | last post: by
reply views Thread by Luc The Perverse | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.