Configuring through IIS
- Hold WIN + R Open command Line input inetmgr Open IIS Management
- Left directory Select target site, in the right IIS block, double-click the Error Pages
- In the Error Pages on the right side of the Actions, select Edit Feature Settings
- In the Error responses, select Detailed errors, the stand-alone OK complete configuration.
From the command line
Enable verbose error:
%windir%\system32\inetsrv\appcmd.exe set config "Default Web site/yourapp"/section:httperrors/errormode:detailed
To disable verbose errors:
%windir%\system32\inetsrv\appcmd.exe set config "Default Web site/yourapp"/section:httperrors/errormode:custom
Configuration via Web.config
In fact, the above in both configurations, will eventually be reflected in the corresponding web.config. Therefore, we can directly edit web.config. In particular, for a purchased virtual host (Shared Web Hosting), there is no permission to change IIS. Open the Site directory, find the Web.config file (if not, set up a TXT file Save as Web.config), locate the System.webserver configuration section, add configuration .
<configuration>
<system.webserver>
<httperrors errormode= "detailedlocalonly" />
</system.webserver>
</configuration>
Attention
- This parameter option can be applied to a Web site or subdirectory or to a virtual directory.
- This parameter option is valid for all IIS applications, including ASP, Aps.net, PHP, and so on.
If it is a asp.net program, you may also need to configure <customerrors mode= "Off"/>
2 |
<customErrors mode=”Off” /> |
In addition, if you are an ASP program, you can also configure the Senderrorstobrowser option:
Configuring through IIS
- Hold WIN + R Open command Line input inetmgr Open IIS Management
- Left directory Select target site, in the right IIS block double-click ASP
- Expand the Debugging Properties node in ASP pages
- Find Send Errors to Browser, select True
- In the right Actions, click Apply
From the command line
Enable:
%windir%\system32\inetsrv\appcmd Set Config-section:asp-scripterrorsenttobrowser:true
Disable:
%windir%\system32\inetsrv\appcmd Set Config-section:asp-scripterrorsenttobrowser:false
Note The site directory cannot be specified after config in the above parameter
Other Links:
The new Configuration System in IIS 7 http://blogs.msdn.com/carlosag/archive/2006/04/25/ Iis7configurationsystem.aspx
system.webserver section Group http:// Msdn.microsoft.com/en-us/library/ms689429.aspx
Improve PHP Error Messages in IIS 7 http://learn.iis.net/page.aspx/765/improve-php-error-messages-in-iis-7/
Tips for Classic ASP developers On IIS7 http://blogs.iis.net/bills/archive/2007/05/21/ Tips-for-classic-asp-developers-on-iis7.aspx
IIS 7 Parent-Child directory install WordPress fixed link problem http://blogs.leoworks.net/php2010/2010/01/13/ break-iis7-url-rewrite-rule-inheritance-for-parent-child-wordpress/