IIS PHP doesn't log errors to log file

白昼怎懂夜的黑 提交于 2019-12-01 11:58:21
Spudley

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.

yanyanqq

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" />

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!