IIS PHP doesn't log errors to log file
Asked Answered
Y

3

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?

Yuonneyup answered 12/7, 2011 at 8:56 Comment(1)
Where is the screenshot at prntscr.com/2aels ?Cruce
T
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.

Topo answered 12/7, 2011 at 9:51 Comment(1)
You totally missed his main question... solving the IIS error log.Cruce
T
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" />

Tingley answered 21/6, 2013 at 14:25 Comment(1)
Note that the server root may not be C:\inetpub\wwwroot.Cruce
P
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

Perimeter answered 12/7, 2011 at 9:15 Comment(0)
T
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.

Topo answered 12/7, 2011 at 9:51 Comment(1)
You totally missed his main question... solving the IIS error log.Cruce

© 2022 - 2024 — McMap. All rights reserved.