This article is a mirror article of machine translation, please click here to jump to the original article.

View: 11513|Reply: 0

[Web] IIS cannot add duplicate collection items of type add when configuring PHP

[Copy link]
Posted on 2/5/2015 9:39:19 AM | | |

Today, when configuring the php program in IIS7, I got the following error

Configuration error When the unique key attribute "value" is set to "index.php", you cannot add a duplicate collection item of type "add"
configuration file \\*******\web\web.config



web.config

<defaultDocument>
<files>
  <add value="index.php" />
</files>
</defaultDocument>

The error is due to the default document set to index.php in IIS, and IIS gets another add with the same value to throw an exception, and the solution is to add <clear /> before < add/>

That is, modify the web.config to:

<defaultDocument>
<files>
<clear />
  <add value="index.php" />
</files>
</defaultDocument>


This approach works well with any .NET configuration that can create inheritance confusion




Previous:The crash of a Taiwanese passenger plane into the river has killed 31 people and injured 17 others, and 12 others are missing
Next:C# is commonly used regular expressions
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com