libmCrypt php-mcrypt on CentOS 6

Encounter error like “configure: error: mcrypt.h not found. Please reinstall libmcrypt.” when trying to build php on CentOS 6 or alike?

Can not Yum install php-mcrypt?

This is becasue CentOS 6.3 Yum base repository dropped support of libmCrypt php-mcrypt… Here is a quick fix to install libmCrypt php-mcrypt on CentOS 6 (and RHEL 6 etc.)

# about EPEL Repo. http://fedoraproject.org/wiki/EPEL/FAQ

# install EPEL Repo. to Yum.
$ rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm

# take a look at what is installed
$ rpm -ql epel-release-6-8.noarch
/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
/etc/rpm/macros.ghc-srpm
/etc/yum.repos.d/epel-testing.repo
/etc/yum.repos.d/epel.repo
/usr/share/doc/epel-release-6
/usr/share/doc/epel-release-6/GPL

# now install libmcrypt and dev if you need to build your own php…
$ yum install libmcrypt.x86_64 libmcrypt-devel.x86_64

# or you can install the php-mcrypt package
$ yum install php-mcrypt.x86_64

Leave a Reply

Your email address will not be published. Required fields are marked *

5 × 4 =