1

My local windows webserver (IIS) doesn't log php errors to log file.The php53_errors.log file is always empty. http://prntscr.com/2aels How to fix it? I think something goes wrong with permission settings. But it shows errors on browser window. And, one more question:Notices like "Undefined index".. Are they really important?

1
  • Where is the screenshot at prntscr.com/2aels ? Commented Aug 27, 2015 at 16:13

3 Answers 3

3

In the IIS server manager tool, there is option call error page. Please disable to use the IE error page to show you the error.

Besides please go to the C:\inetpub\wwwroot\web.config this file controls how to display and log the error as well. It should have one line like this. <httpErrors errorMode="Detailed" />

Sign up to request clarification or add additional context in comments.

1 Comment

Note that the server root may not be C:\inetpub\wwwroot.
2

Do you have php.ini in right setup according to this?

http://php.net/manual/en/install.windows.manual.php

specially keys log_errors and error_log

Comments

0

Read the last part of your question:

Notices like "Undefined index".. Are they really important?

It depends on your definition of 'important'.

The easy answer is no, they're not important. That's the reason they're classified as notices rather than warnings. It's okay to ignore them.

However you should still pay attention to them, and try to fix them where possible.

For example, the notice you quoted "Undefined index". This is caused (as I'm sure you're aware) by referencing an array element that hasn't yet been defined.

It is best practice to prevent this notice from being raised by using isset(), because if you do that, then when you do still get the notice, you'll know it is important - maybe you made a typo in your variable name or array index? The code will still run, but it won't work properly, and getting the notice might be the first clue you have of that. If that notice is suppressed or drowned out by legitimate ones, you'll never spot it.

Most 'notices' raised by PHP are on a similar level to that -- they indicate that something might be wrong, but PHP doesn't know for sure. If you write your code defensively to prevent notices from being raised when you're happy with the code, then you can afford to pay more attention to the ones that do still crop up.

Hope that helps.

1 Comment

You totally missed his main question... solving the IIS error log.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.