IIS7下如何显示PHP错误(不显示500错误,而显示详细错误)
IIS7下如何显示PHP错误(不显示500错误,而显示详细错误)
1、除了将php.ini配置为:
display_errors = on;
error_reporting = E_ALL & ~E_NOTICE;
2、还要再php网站的根目录下面新建一个web.config文件:
iis的配置, 注意你首先需要在你的网站根目录添加web.config文件:
代码如下:
注意把下列代码中的@替换成<
@?xml version="1.0" encoding="UTF-8"?>@configuration>
@system.web>
@compilation debug="true" targetFramework="4.5"/>
@httpRuntime targetFramework="4.5"/>
@/system.web>
@system.webServer>
@httpErrors errorMode="DetailedLocalOnly" existingResponse="PassThrough">@/httpErrors>
@/system.webServer>
@/configuration>