Configure IIS7 display verbose error information _win server

Source: Internet
Author: User
Tags php error classic asp install wordpress web hosting

Configuring through IIS

    1. Hold WIN + R Open command Line input inetmgr Open IIS Management
    2. Left directory Select target site, in the right IIS block, double-click the Error Pages
    3. In the Error Pages on the right side of the Actions, select Edit Feature Settings
    4. 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"/>

View Source
Print?
1 <system.web>
2    <customErrors mode=”Off” />
3 </system.web>

In addition, if you are an ASP program, you can also configure the Senderrorstobrowser option:

Configuring through IIS

    1. Hold WIN + R Open command Line input inetmgr Open IIS Management
    2. Left directory Select target site, in the right IIS block double-click ASP
    3. Expand the Debugging Properties node in ASP pages
    4. Find Send Errors to Browser, select True
    5. 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/

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.