Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2004-08-02
3
Medium Priority
?
264 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 1500 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

WordPress Tutorial 2: Terminology

An important part of learning any new piece of software is understanding the terminology it uses. Thankfully WordPress uses fairly simple names for everything that make it easy to start using the software.

Question has a verified solution.

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

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
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…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

730 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