ArticleDirectory
- Configure through IIS
- Use command line
- Configure through web. config
- Configure through IIS
- Use command line
Configure through IIS
- Press and hold win + R to open the command line and enter inetmgr to open IIS Management
- Select the target site in the left directory, and double-click error pages in the IIS block on the right.
- In error pages, select Edit feature settings on the right side of actions.
- In error responses, select detailed errors and click OK on the single machine to complete the configuration.
Use command line
Detailed enabling error:
% Windir % \ system32 \ inetsrv \ appcmd.exe set config "Default web site/yourapp"/section: httperrors/errormode: Detailed
Forbidden details error:
% Windir % \ system32 \ inetsrv \ appcmd.exe set config "Default web site/yourapp"/section: httperrors/errormode: custom
Configure through web. config
In fact, the above two configurations will eventually be reflected in the corresponding web. config. Therefore, you can directly edit web. config. Especially for purchased virtual hosts (shared Web Hosting), you are not authorized to change IIS. Open the website directory, find the Web. config file (if not, create a TXT file and save it as Web. config), find the system. webserver configuration section, and add the configuration<Httperrors errormode = "detailedlocalonly"/>.
< Configuration >
< System. Webserver >
< Httperrors Errormode = "Detailedlocalonly" />
</ System. Webserver >
</ Configuration >
Note:
- This parameter option can be applied to websites, subdirectories, or virtual directories.
- This parameter applies to all IISProgramValid, including ASP, APs. net, and PHP.
For ASP. NET programs, you may need to configure<Customerrors mode = "off"/>
View Source
Print?
2 |
<Customerrors mode = "off"/> |
In addition, if it is an ASP program, you can also configure the senderrorstobrowser option:
Configure through IIS
- Press and hold win + R to open the command line and enter inetmgr to open IIS Management
- Select the target site in the left directory, and double-click ASP in the IIS block on the right
- Expand the debugging properties node on the ASP page
- Find send errors to browser and select true
- In actions on the right, click Apply
Use 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 that 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 and Child directories with fixed links while installing WordPress issue http://blogs.leoworks.net/php2010/2010/01/13/break-iis7-url-rewrite-rule-inheritance-for-parent-child-wordpress/