Solved

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

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

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…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

786 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