Install php-mcrypt on CentOS 6
I have been trying to install php-mcrypt for a while now. Everytime I get the "No package php-mcrypt available." returned to me. Here's what I've tried:
root@ip-********** [~]# yum install php-mcrypt --enablerepo=centosplus (<- both with and without this)
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: p3plmirror01.prod.phx3.secureserver.net
* centosplus: p3plmirror01.prod.phx3.secureserver.net
* epel: mirrors.solfo.com
* extras: p3plmirror01.prod.phx3.secureserver.net
* updates: p3plmirror01.prod.phx3.secureserver.net
centosplus | 3.5 kB 00:00
centosplus/primary_db | 746 kB 00:00
Setting up Install Process
No package php-mcrypt available.
Error: Nothing to do
I have made sure to install the EPEL repository. At this point I'm just stumped. I've followed EVERY tutorial I've found online and get the same error.
Notes: Go Daddy VPS, CentOS 6.4 64-bit, mcrypt installed without a hitch, but no php-mcrypt.
Solution 1:
I had the same issue, and found the previous suggestions gave me enough info to get it working on my server. The following is what I did:
1) Install EPEL repository (From: http://www.rackspace.com/knowledge_center/article/installing-rhel-epel-repo-on-centos-5x-or-6x):
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
sudo rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm
2) Install it via:
yum update
yum install php-mcrypt*
The yum update
updated the repository reference on my server then the 2nd command got what I needed :)
3) Restart your webserver. For my apache install I did:
service httpd restart
Solution 2:
For me the answer was:
1) Get the Repos from
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
sudo rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm
2) Install it via:
sudo yum update
sudo yum install php-mcrypt*
3) Edit the mcrypt.ini
sudo nano /etc/php.d/mcrypt.ini
add this
extension=/usr/lib64/php/modules/mcrypt.so
Finally 4) Restart your webserver:
sudo service httpd restart
I run this steps in CentOS 6.3 (64) on Azure From Microsoft Linux image
Hope it helps you.
Best Regards.
Solution 3:
Updated Answer for centos 7
## RHEL/CentOS 7 64-Bit ##
# wget http://dl.fedoraproject.org/pub/epel/beta/7/x86_64/epel-release-7-0.2.noarch.rpm
# rpm -ivh epel-release-7-0.2.noarch.rpm
For CentOS 6
## RHEL/CentOS 6 32-Bit ##
# wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
# rpm -ivh epel-release-6-8.noarch.rpm
## RHEL/CentOS 6 64-Bit ##
# wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm -ivh epel-release-6-8.noarch.rpm
Install
yum install php-mcrypt
Edit: See comments for updated repositories.