我在你身邊轉載了你的問題。經過一番調查後,我找到了一種讓Imagick和Composer都能在Azure WebApp上工作的方法。我知道它並不漂亮,但它確實有效。
1)使用FTP或SCM(websitename.SCM.azurewebsites.net)進入D:\home\SiteExtensions\ComposerExtension
fodler,並刪除applicationHost.xdt
文件。
2)合併上面刪除的文件的內容到D:\home\site\applicationHost.xdt
。在此之後,xdt
文件應該是這個樣子:
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<system.applicationHost>
<sites>
<site name="%XDT_SCMSITENAME%" xdt:Locator="Match(name)">
<application path="/Composer" applicationPool="%XDT_APPPOOLNAME%" xdt:Transform="Insert">
<virtualDirectory path="/" physicalPath="%XDT_EXTENSIONPATH%" />
</application>
</site>
</sites>
</system.applicationHost>
<system.webServer>
<runtime xdt:Transform="InsertIfMissing">
<environmentVariables xdt:Transform="InsertIfMissing">
<add name="MAGICK_HOME" value="d:\home\site\ext\" xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing" />
<add name="MAGICK_CODER_MODULE_PATH" value="d:\home\site\imagickwin\" xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing" />
<add name="APPSETTING_COMMAND" value="%HOME%\SiteExtensions\ComposerExtension\Hooks\deploy.cmd" />
<add name="COMPOSER_ARGS" value="--prefer-dist --no-dev --optimize-autoloader --no-progress" />
<add name="PATH" value="%PATH%;%PATH%d:\home\site\ext\;%HOME%\SiteExtensions\ComposerExtension\Commands;%APPDATA%\Composer\vendor\bin" />
</environmentVariables>
</runtime>
<rewrite xdt:Transform="InsertIfMissing">
<rules xdt:Transform="InsertIfMissing">
<rule name="RequestBlockingRule1" xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{URL}" pattern="vendor/(.*)$" />
</conditions>
<action type="CustomResponse" statusCode="403" statusReason="Forbidden: Access is denied." statusDescription="You do not have permission to view this directory or page using the credentials that you supplied." />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
3)現在,重新啓動您的應用程序,他們應該共同努力。
謝謝你,它的工作這一次!不知道爲什麼它沒有工作之前,我想我可能會添加一些錯誤的論點,導致PHP的一般錯誤。我希望微軟有更優雅的解決方案,並希望稍後它不會引起Imagick的問題。 – gibengy