Solved

No error ouput to page on parse error in PHP (IIS 6)

Posted on 2004-08-02
3
262 Views
Last Modified: 2013-12-13
I have a very basic installation of PHP running on a windows 2003 server runing the latest version of IIS 6.  I followed one of the readily available installation guides and it has been working quite well.  The only problem is that when a parse error occurs the error is not sent to the web browser.  I am assume it is logged somewhere, but that does not do me too much good.  How can I enable error output to the broswer?

On an error the browser window is blank containing only very basic HTML code (must be the default for IIS or something):

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1252"></HEAD>
<BODY></BODY></HTML>

Any thoughts?
0
Comment
Question by:superdigitdave
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 27

Accepted Solution

by:
Diablo84 earned 500 total points
ID: 11699405
in your php.ini file (located in the windows folder in c:) search for the following section

; Error handling and logging ;

and check the following settings are set in your file

error_reporting  = E_ALL;

or (to show all errors except notices)

error_reporting  = E_ALL & ~E_NOTICE;

and

display_errors = On


Failing that check that there is not a die or exit statement in your script which is terminating the script (and thus wont output any code)

ie.

die();

or

exit;

Diablo
0
 
LVL 27

Expert Comment

by:Diablo84
ID: 11699437
by the way if you make changes to you php.ini file you will have to restart IIS for the changes to take effect.
0
 
LVL 40

Expert Comment

by:Richard Quadling
ID: 11702140
Also, look for code with @ in front ...

<?php

$fp = fopen('I don't exist and will cause an error','r);

?>

will cause an error, but ...

<?php

$fp = @fopen('I don't exist and will cause an error','r);

?>


will not.

Normally, the above line would look like ...

<?php

$fp = @fopen('I don't exist and will cause an error','r) or die('Could not open the non existant file.');

?>


Richard.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question