我正在使用Azure網站構建簡單的PHP Web服務,並且無法使其支持PUT和DELETE http方法。假設這是必須進入web.config文件的東西 - 我已經嘗試了一些來自interwebs的選項,但它們中的一些看起來沒有正常工作。有任何想法嗎?Azure網站PHP API - 405方法不允許使用PUT和DELETE
這裏的web.config文件,因爲它目前爲:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<handlers>
</handlers>
<security>
</security>
<directoryBrowse enabled="false" />
<caching>
<profiles>
<add extension=".php" policy="DontCache" kernelCachePolicy="DontCache" />
<add extension=".html" policy="CacheForTimePeriod" kernelCachePolicy="CacheForTimePeriod" duration="14:00:00" />
</profiles>
</caching>
<rewrite>
<rules>
<rule name="block favicon" stopProcessing="true">
<match url="favicon\.ico" />
<action type="CustomResponse" statusCode="404" subStatusCode="1"
statusReason="The requested file favicon.ico was not found"
statusDescription="The requested file favicon.ico was not found" />
</rule>
<rule name="Cols Rule" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
<add input="{URL}" pattern="^/favicon.ico$" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.php?q={R:1}" appendQueryString="true" />
</rule>
</rules>
</rewrite>
<defaultDocument>
<files>
<remove value="index.php" />
<add value="index.php" />
</files>
</defaultDocument>
</system.webServer>
</configuration>
幾天前我看到了類似的線程。在這種情況下,事實證明PUT動詞被內部網絡阻塞。你能檢查一下,這是不是這種情況? – 2013-04-09 17:36:36