Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install php-mcrypt on CentOS 6

Tags:

php

centos

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: GoDaddy VPS, CentOS 6.4 64-bit, mcrypt installed without a hitch, but no php-mcrypt.

like image 997
Scott Dawson Avatar asked Jun 14 '13 13:06

Scott Dawson


People also ask

How do I enable mcrypt?

You can install Mcrypt from the PHP Source Tree as a module if you choose. Enable the module by adding: 'extension=mcrypt.so' to PHP. ini. Done!

How do I know if PHP mcrypt is installed?

You can also achieve this same screen by viewing a php file that has: phpinfo(); somewhere in the code. In this screen, simply search for the string "mcrypt support". If installed, you will see a box that says "enabled".

What is PHP mcrypt package?

What is mcrypt? The mcrypt extension is a replacement for the UNIX crypt command. These commands serve as a means to encrypt files on UNIX and Linux systems. The php-mcrypt extension serves as an interface between PHP and mcrypt.


Video Answer


3 Answers

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
like image 149
James Oravec Avatar answered Oct 22 '22 08:10

James Oravec


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.

like image 26
Compusam Avatar answered Oct 22 '22 08:10

Compusam


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.

like image 11
TylersSN Avatar answered Oct 22 '22 08:10

TylersSN