首先 Mac 上已经安装 brew
MAMP PRO version 5.6
PHP 7.2.10
安装这两个库 libtomcrypt && mcrypt
brew search mcrypt
brew install libtomcrypt
brew install mcrypt
下载 mcrypt 的源码包
点解进去: mcrypt
选择对应的版本

解压
进入源码包文件目录下执行
/Applications/MAMP/bin/php/php7.2.10/bin/phpize
写入配置
./configure --with-php-config=/Applications/MAMP/bin/php/php7.2.10/bin/php-config
(这个路径要视情况而定)
make
make install
Linux中./configure、make、make install 命令 介绍
打开mamp进入 File->Edit Template ->PHP(php.ini) 修改配置模板文件

添加一行
内容:
extension=mcrypt.so

查看 php 的 扩展


网友评论