1. 程式人生 > 實用技巧 >【應用服務 App Service】Azure App Service 中如何安裝mcrypt - PHP

【應用服務 App Service】Azure App Service 中如何安裝mcrypt - PHP

問題描述

Azure App Service (應用服務)如何安裝PHP的擴充套件 mcrypt(mcrypt是php裡面重要的加密支援擴充套件庫)

準備條件

  • 建立App Service, Runtime stack 選擇為PHP,如圖

注:選擇Non Thread的原因是因為App Service的支援要求.https://docs.microsoft.com/en-us/azure/app-service/configure-language-php?pivots=platform-windows#enable-php-extensions

Enable PHP extensions

The best way to see the PHP version and the currentphp.iniconfiguration is to callphpinfo()in your app.

... ...

Add abindirectory to the root directory of your app and put the.dllextension files in it (for example,mongodb.dll). Make sure that the extensions are compatible with the PHP version in Azure and are VC9 and non-thread-safe (nts) compatible

.

操作步驟

1)登入到Kudu站點,選擇DebugConsole -> CMD。點選site和wwwroot資料夾後,進入wwwroot目錄(兩種方式登入Kudu。一:Azure App Service Overview ->Advanced Tools

-> Go。 二:在站點URL加上SCM訪問。如:https://xxxxxx.scm.chinacloudsites.cn/)

2)在wwwroot目錄中新建bin資料夾,並把php_mcrypt-1.0.3-7.2-nts-vc15-x86.zip壓縮包中的內容解壓後放入bin目錄中(放入方式為 選中檔案後直接拖拽到Kudu頁面中bin資料夾區域

3)在wwwroot目錄中新建info.php。檔案內容包含phpinfo()函式的輸出資訊(點選資料夾旁邊的加號建立新檔案,然後點選檔案左邊的