Solved

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

Posted on 2004-08-02
3
261 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Wordpress Pagination 1 44
check mysql insert 12 39
Checking https returns 301 21 55
How do I update select listbox after search 2 22
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…
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

735 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