Configure iis7 to display detailed error information

Source: Internet
Author: User
Tags php error classic asp web hosting
ArticleDirectory
    • Configure through IIS
    • Use command line
    • Configure through web. config
    • Configure through IIS
    • Use command line

Configure through IIS
    1. Press and hold win + R to open the command line and enter inetmgr to open IIS Management
    2. Select the target site in the left directory, and double-click error pages in the IIS block on the right.
    3. In error pages, select Edit feature settings on the right side of actions.
    4. 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?

1 <System. Web>
2 <Customerrors mode = "off"/>
3 </System. Web>

In addition, if it is an ASP program, you can also configure the senderrorstobrowser option:

Configure through IIS
    1. Press and hold win + R to open the command line and enter inetmgr to open IIS Management
    2. Select the target site in the left directory, and double-click ASP in the IIS block on the right
    3. Expand the debugging properties node on the ASP page
    4. Find send errors to browser and select true
    5. 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/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.