Solved

PHP Error Reporting under IIS 6.0

Posted on 2008-10-06
4
2,090 Views
Last Modified: 2013-12-13
Hello,

I'm having an issue getting errors to output to the browser with PHP under IIS 6.0 on Windows Server 2003. I've set the php.ini file in the Windows directory by uncommenting:

error_reporting  =  E_ALL
dispaly_errors = On

And I've also tried setting the values at runtime in my scripts with:

ini_set('display_errors', 0)
ERROR_REPORTING(E_ALL);

But I'm unable to throw any errors. I'm basically using an includes statement in a script to a file that doesn't exist, but the script still executes error free; no suppression directives, etc used anywhere.  Thinking it's an IIS thing since I never ran into this under Apache.

Any insight would be greatly appreciated.

0
Comment
Question by:jmoriarty
  • 2
  • 2
4 Comments
 
LVL 2

Accepted Solution

by:
AdiF earned 500 total points
ID: 22656325
Please try specifying an error log file in your php.ini and check it to ensure that errors are being logged.

Is the rest of the PHP script outputting content to your browser, or are you receiving an HTTP 500 Internal Server Error message?

Try also setting display_startup_errors to On because I think an include() might be considered a startup routine thing hehe.

Try also running a phpinfo(); script and check the output to ensure that the path for the php.ini is the file you are editing.

If you are using ISAPI or FastCGI you should restart the IIS service every time you modify your php.ini for full changes to take effect.
0
 

Author Comment

by:jmoriarty
ID: 22656454
Hi AdiF,

Interestingly, no, the script outputs nothing when an error is present, even if I do something simple like the attached code snippet. If I remove the require statement, the echo output's fine however.  No internal server either though, just a blank, white screen.

PHP is configured as an ISAPI module, and I did restart IIS after each change. I restarted again just now to triple check, same affect.

Double checked phpinfo(); and it is pulling from the C:\Windows .ini, so we're okay there, and startup errors are actually on. display_startup_errors = On

 no errors are logged, either. error_logging = On in .ini, and
error_log = "C:/PHP/logs/err.log" directive set as well.

Strange, eh?

<?php
 

require("filedoesnotexist.php");  
 

// Get the current include path settings from php config file

$path = ini_get('include_path');

echo $path
 

?>

Open in new window

0
 

Author Comment

by:jmoriarty
ID: 22660976
Found the problem - I was completely misreading the phpinfo() output. The loaded config file was actually in another directory. D'oh.

Thanks for the help either way.

0
 
LVL 2

Expert Comment

by:AdiF
ID: 22664888
...*snickers*  :)  hehehe.  troubleshooting is a pain-- finding out you've overlooked a troubleshooting candidate is even more annoying :P

no problem!
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
This article discusses how to create an extensible mechanism for linked drop downs.
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 …

708 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now