【应用服务 App Service】Azure App Service 中如何安装mcrypt - PHP

简介: 【应用服务 App Service】Azure App Service 中如何安装mcrypt - PHP

问题描述

Azure App Service (应用服务)如何安装PHP的扩展 mcrypt(mcrypt 是php里面重要的加密支持扩展库),同样改方法也适用于其他的扩展安装。在门户的配置项上添加PHP_EXTENSIONS,如有多个扩展使用逗号,分隔。

准备条件

  • 创建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 current php.ini configuration is to call phpinfo() in your app.

... ...

Add a bin directory to the root directory of your app and put the .dll extension 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()函数的输出信息(点击文件夹旁边的加号创建新文件,然后点击文件左边的🖊按钮编辑文件内容

<?php
phpinfo();
phpinfo(INFO_MODULES);
?>


4)回到App Service 的配置页面 (Azure App Service Overview -> Configuration -> Application settings),添加参数PHP_EXTENSIONS,值为bin\php_mcrypt.dll

5)重启站点,访问info.php页面参看mcrypt插件信息,如:https://xxxxxx.chinacloudsites.cn/info.php

 

参考资料

Enable PHP extensionshttps://docs.microsoft.com/en-us/azure/app-service/configure-language-php?pivots=platform-windows#enable-php-extensions

 

mcrypt 1.0.3 for Windows : https://pecl.php.net/package/mcrypt/1.0.3/windows

相关文章
|
6月前
|
编译器 Linux PHP
【Azure App Service】为部署在App Service上的PHP应用开启JIT编译器
【Azure App Service】为部署在App Service上的PHP应用开启JIT编译器
|
6月前
|
缓存 NoSQL 网络安全
【Azure Redis 缓存】Azure Redis服务开启了SSL(6380端口), PHP如何访问缓存呢?
【Azure Redis 缓存】Azure Redis服务开启了SSL(6380端口), PHP如何访问缓存呢?
|
4月前
|
开发工具 iOS开发 MacOS
【Mac_mistake】app不能安装在未命名需要OSv11.13或更高版本
【Mac_mistake】app不能安装在未命名需要OSv11.13或更高版本
242 0
|
6月前
|
PHP Windows
【Azure App Service for Windows】 PHP应用出现500 : The page cannot be displayed because an internal server error has occurred. 错误
【Azure App Service for Windows】 PHP应用出现500 : The page cannot be displayed because an internal server error has occurred. 错误
|
6月前
|
PHP 开发工具 git
【Azure 应用服务】在 App Service for Windows 中自定义 PHP 版本的方法
【Azure 应用服务】在 App Service for Windows 中自定义 PHP 版本的方法
|
6月前
|
PHP
PHP——oneinstack重新安装PHP的时候报错
PHP——oneinstack重新安装PHP的时候报错
94 4
|
6月前
|
PHP
PHP——安装ThinkPHP框架报错
PHP——安装ThinkPHP框架报错
71 0
|
8月前
|
Ubuntu PHP
ubuntu php libzip安装 ./configure报错 checking for libzip... not found configure
ubuntu php libzip安装 ./configure报错 checking for libzip... not found configure
144 1

热门文章

最新文章

  • 1
    iOS|记一名 iOS 开发新手的前两次 App 审核经历
    10
  • 2
    2025同城线下陪玩APP开发/电竞游戏平台搭建游戏陪玩APP源码/语音APP开发
    17
  • 3
    flutter3-wetrip跨平台自研仿携程app预约酒店系统模板
    25
  • 4
    通过外部链接启动 Flutter App(详细介绍及示例)
    21
  • 5
    【03】仿站技术之python技术,看完学会再也不用去购买收费工具了-修改整体页面做好安卓下载发给客户-并且开始提交网站公安备案-作为APP下载落地页文娱产品一定要备案-包括安卓android下载(简单)-ios苹果plist下载(稍微麻烦一丢丢)-优雅草卓伊凡
    55
  • 6
    【02】仿站技术之python技术,看完学会再也不用去购买收费工具了-本次找了小影-感觉页面很好看-本次是爬取vue需要用到Puppeteer库用node.js扒一个app下载落地页-包括安卓android下载(简单)-ios苹果plist下载(稍微麻烦一丢丢)-优雅草卓伊凡
    46
  • 7
    【01】仿站技术之python技术,看完学会再也不用去购买收费工具了-用python扒一个app下载落地页-包括安卓android下载(简单)-ios苹果plist下载(稍微麻烦一丢丢)-客户的麻将软件需要下载落地页并且要做搜索引擎推广-本文用python语言快速开发爬取落地页下载-优雅草卓伊凡
    40
  • 8
    【Azure Function】Function App门户上的Test/Run返回错误:Failed to fetch
    36
  • 9
    小游戏源码开发之可跨app软件对接是如何设计和开发的
    42
  • 10
    原生鸿蒙版小艺APP接入DeepSeek-R1,为HarmonyOS应用开发注入新活力
    178