Mac下安装php扩展mcrypt
1、确定libmcrypt已经安装在本机,如果没安装,先安装这个,安装方法
cd ~/Downloads/libmcrypt-2.5.8
./configure --disable-posix-threads --enable-static
make
sudo make install
2、找到自己php版本,下载php完整安装包
cd ~/Downloads/php-5.5.14/ext/mcrypt
phpize
./configure
make
cd modules
sudo cp mcrypt.so /usr/lib/php/extensions/no-debug-non-zts-20121212/
如果phpize出现如下错误:
grep: /usr/include/php/main/php.h: No such file or directory
grep: /usr/include/php/Zend/zend_modules.h: No such file or directory
grep: /usr/include/php/Zend/zend_extensions.h: No such file or directory
Configuring for:
PHP Api Version:
Zend Module Api No:
Zend Extension Api No:
Cannot find autoconf. Please check your autoconf installation and the
$PHP_AUTOCONF environment variable. Then, rerun this script.
需要执行,注意下面mac版本号
sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/
Developer/SDKs/MacOSX10.11.sdk/usr/include /usr/include
如果
4:打开php.ini
sudo vi /etc/php.ini
添加如下代码:(注意no-debug-non-zts-20121212版本号,如果不清楚可以前往/usr/lib/php/extensions/查看)
extension=/usr/lib/php/extensions/no-debug-non-zts-20121212/mcrypt.so
重启apache即可
最新内容
- Linux系统下systemctl常用命令以及service文件配置
- CI PHP7 session 不能读取的问题
- centos 7.4 基本配置
- mysqldump导入导出数据库总结
- Linux下的tar压缩解压缩常用命令
- 查看 SELinux状态、临时关闭SELinux、永久关闭SELinux
- centos6.8 yum安装mysql 5.6
- CentOS之7与6的区别2
- CentOS之7与6的区别1
- Mysql 忘记root密码的完美解决方法
- 输入密码登录,Linux scp (rsync)设置nohup后台运行
- ubantu zabbix部署——安装配置zabbix agent详解
- Zabbix客户端(agent端口)安装配置
- CentOS 7添加开机启动服务/脚本
- 阿里云机器配置 centos 6.8