PHP 7.1 安装 mcrypt 扩展
安装步骤
- 下载扩展源码并解压
wget https://pecl.php.net/get/mcrypt-1.0.1.tgz
tar zxvf mcrypt-1.0.1.tgz
- 运行phpize
cd mcrypt-1.0.1
/usr/local/Cellar/php@7.1/7.1.33_4/bin/phpize
- 指定php配置
cd mcrypt-1.0.1
./configure --with-php-config=/usr/local/Cellar/php@7.1/7.1.33_4/bin/php-config
- 编译和安装
make && make install
- 修改php.ini
.
.
.
extension="mcrypt.so"
.
.
.
重启服务
brew services restart php@7.1
验证扩展
/usr/local/Cellar/php@7.1/7.1.33_4/bin/php --ri mcrypt
# 如果显示 mcrypt 的扩展信息, 那么安装成功