代码语言:javascript复制
CentOS下php安装mcrypt扩展
(以下步骤均为本人实际操作,可能与你的安装方法有所区别,但我会尽量排除疑惑)
大致步骤(1)安装mcrypt,(2)安装php对mcrypt的扩展,(3)重启apache
(1)、确认你的linux没有安装mcrypt库,如果已安装,跳过安装步骤
[root@test-206 ~]# yum list installed|grep mcrypt
libmcrypt.x86_64 2.5.8-4.el5.centos installed
libmcrypt-devel.x86_64 2.5.8-4.el5.centos installed
mcrypt.x86_64 2.6.8-1.el5 installed
以上显示已经安装过,若没有,则按以下两种方式安装
yum命令懒人安装
yum install libmcrypt libmcrypt-devel mcrypt mhash
执行后会显示即将安装的相关库,你可以根据你的linux限定x86_64或者i386,如yum install libmcrypt.x86_64(如果yum命令无法连接仓库,请检查你的/etc/yum.repos.d/里的文件正确性,以及你的/etc/host是不是可达里面的域名)
Dependencies Resolved================================================================================
Package Arch Version Repository Size================================================================================Installing:
libmcrypt i386 2.5.7-5.el5 epel 124 k
libmcrypt x86_64 2.5.8-4.el5.centos extras 105 k
libmcrypt-devel i386 2.5.7-5.el5 epel 103 k
libmcrypt-devel x86_64 2.5.8-4.el5.centos extras 10 k
mcrypt x86_64 2.6.8-1.el5 epel 88 k
mhash i386 0.9.2-6.el5 epel 141 k
mhash x86_64 0.9.9-1.el5.rf rpmforge 161 k
Transaction Summary================================================================================Install 7 Package(s)
Upgrade 0 Package(s)
Total download size: 731 k
Is this ok [y/N]:
确定安装,最后显示
Installed:
libmcrypt.x86_64 0:2.5.8-4.el5.centos
libmcrypt-devel.x86_64 0:2.5.8-4.el5.centos
mcrypt.x86_64 0:2.6.8-1.el5
mhash.x86_64 0:0.9.9-1.el5.rf
Complete!