Jump to content

PHP pages not displaying if a warning or notice is brought up


joraff

Recommended Posts

IIS 6, Windows Server 2003, PHP 5.2.6

 

If a script raises a PHP Warning or PHP Notice, then the error message is displayed but the php output and HTML is not rendered. If i disable error reporting locally via ini_set() or error_reporting(), then the page displays just fine.

 

I couldn't find any initiatives that would specifically address this, nor did google do much help - mainly because I don't know what I'm searching for.

 

Does anyone know whats going on?

 

 

 

Link to comment
Share on other sites

  • 2 months later...

Hello,

 

  Locate your php.ini (easiest way would be to create a .php file with the following contents and then visit it in a browser:

 

<?php phpinfo(); ?>

 

Then, locate that php.ini file and set the following directives (if they are not set):

 

error_reporting = E_ALL & ~E_NOTICE

 

  This should clear up your problems.  That will hide all of your notices and coding warnings.  Keep in mind that it is not suggested to display default errors on production websites.  Instead, it is suggested to simply log them. 

 

  Please try visiting the following URL to gather more information on php.ini and all of the features and directives that are able to be modified / customized.  http://us.php.net/manual/en/ini.list.php.

 

Please keep in mind:  Before you modify your php.ini file, ALWAYS MAKE A BACKUP.

 

Also, within IIS, whenever you change php.ini, if you want the changes to take effect then you have to restart iis.  The easiest way to perform that operation is to go to:

 

1. Start

2. Click Run

3. (Without the quotes) Type "iisreset"

4. Click OK

5. A black box will pop up reporting that it is stopping and starting a few services. Once IIS is back up and running, the box will close again on its own.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.