CentOS 6.5 64位下php扩展mcrypt的安装,新增epel源,再采用yum安装!

缺少mcrypt扩展。请检查PHP配置。

 

执行yum install php-mcrypt提示:Error: Nothing to do

原因在于官方源中无些扩展包!由于源码编译安装比较麻烦,决定再增加一个源,最终决定采用epel源。
安装epel源的步骤如下:

1、安装yum优先级插件

yum install yum-priorities

2、epel简介: https://fedoraproject.org/wiki/EPEL/zh-cn

rpm -Uvh http://mirrors.ustc.edu.cn/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

注:只要是6.x系列的均是可以采用6-8的,实际测试,没有什么问题。

以上URL请按实际情况修改

3、查看是否安装成功

rpm -q epel-release
4、导入key:

rpm –import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

5、修改/etc/yum.repos.d/epel.repo文件

在[epel]块的最后一行添加一条属性 priority=11

vim /etc/yum.repos.d/epel.repo

意思是yum先去官方源查,官方没有再去epel的源找

在[epel]块的最后一行添加一条属性 priority=11

6、yum repolist

查看是否添加epel源成功与否

7、载入yum-priorities插件

yum check-update

再依次执行如下3条命令:

yum install libmcrypt libmcrypt-devel mcrypt mhash

yum install php-mcrypt

service httpd restart

确认mcrypt库安装成功

mcrypt扩展安装成功,不再提示!

永夜