2017-08-17 14 views
0

私はローカルサーバー上でPHP APIを完成させました。今、私はAzureのWebアプリケーションにデプロイしようとしたが、同様に、任意のGET/POSTリクエスト中にエラーを取得:デフォルトではAzure Websites PHP API - 500メソッドが許可されていません

<configuration> 
    <location> 
     <system.webServer> 
      <security> 
       <authentication> 
        <anonymousAuthentication enabled="true" /> 
        <iisClientCertificateMappingAuthentication enabled="true" oneToOneCertificateMappingsEnabled="true" manyToOneCertificateMappingsEnabled="false" logonMethod="ClearText"> 
         <oneToOneMappings> 
          <clear /> 
          <add userName="domain\user" password="pass" certificate="the certificate blob" /> 
         </oneToOneMappings> 
         <manyToOneMappings> 
          <clear /> 
         </manyToOneMappings> 
        </iisClientCertificateMappingAuthentication> 
        <windowsAuthentication enabled="false" /> 
       </authentication> 
       <access sslFlags="Ssl, SslNegotiateCert, SslRequireCert" /> 
      </security> 
      <defaultDocument enabled="true"> 
       <files> 
        <clear /> 
        <add value="index.php" /> 
        <add value="index.htm" /> 
        <add value="index.html" /> 
       </files> 
      </defaultDocument> 
      <handlers> 
       <remove name="PHP53_via_FastCGI" /> 
       <add name="PHP53_via_FastCGI" path="*.php" verb="GET, PUT, POST, HEAD, OPTIONS, TRACE, PROPFIND, PROPPATCH, MKCOL, COPY, MOVE, LOCK, UNLOCK" modules="FastCgiModule" scriptProcessor="D:\Program Files (x86)\PHP\v5.3\php-cgi.exe" resourceType="Either" requireAccess="Script" 
       /> 
      </handlers> 
     </system.webServer> 
    </location> 
</configuration> 
+0

*「方法は許可されていません」* – Phil

答えて

1

、PHPのV5:ここに私のweb.configファイルである enter image description here

。 3はではなく、Azure Web Appで利用可能なです。問題が発生する可能性があります。 PHPランタイムをv5.5またはそれ以上にアップグレードすることができます。

enter image description here

以下でごhandlers設定を置き換えます。それは動作するはずです。あなたはAzureのWeb AppでPHP 5.3を実行するために継続したい場合は

<handlers> 
    <remove name="PHP56_via_FastCGI" /> 
    <add name="PHP56_via_FastCGI" path="*.php" verb="GET, PUT, POST, HEAD, OPTIONS, TRACE, PROPFIND, PROPPATCH, MKCOL, COPY, MOVE, LOCK, UNLOCK" modules="FastCgiModule" scriptProcessor="D:\Program Files (x86)\PHP\v5.6\php-cgi.exe" resourceType="Either" requireAccess="Script" /> 
</handlers> 

、明示的にあなたのサイトのPHPランタイムを設定するにはHow to: Use a custom PHP runtimeの手順に従ってください。

関連する問題