RHEL6 and CentOS 6: missing libmcrypt and libmhash in default repository

For God-knows-what reason, the libmcrypt and libmhash aren't included in the default repository for CentOS 6 or Red Hat Enterprise Linux 6. So you'll run into the following when trying to compile PHP.

configure: error: mcrypt.h not found. Please reinstall libmcrypt.

And you can't install it.

# yum install libmcrypt-devel
...
No package libmcrypt-devel available.
Error: Nothing to do

The (only) solution so far: grab the packages from the EPEL repository. Download the RPM (it's same RPM for i386, i686 and x86_64) and install it.

# rpm -ivh “http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm”

And you can install it as "yum install libmcrypt-devel" again. Or libmhash, just the same.

8 comments on “RHEL6 and CentOS 6: missing libmcrypt and libmhash in default repository
  1. Levent Pinar says:

    Thanks, worked as described

  2. Bryon says:

    A+++ thanks, 10/10

  3. indra says:

    thanks Mattias, you saved my day

  4. Yatin says:

    Updated URL … rpm -ivh “http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm”

  5. Ashwani says:

    Thanks Mattias

  6. Sharl says:

    thx for sharing this point.

Leave a Reply

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

*

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Advertisement

Why ads?

I'm glad you made it to this blogpost. I hope it helps solve your problem. So why then do I show ads on the site? Writing content, testing it and making sure the layout isn't totally b0rked takes time. A lot of time. The ads are a way to pay back a small portion of that time.

And as you know running a site costs (a bit of) money: the domain name, webhosting, time spent writing and updating content, ... So if you like the content of this blog, consider disabling your AdBlocker for this domain. Thanks!

Looking for help?

Tired of fixing all these tech-problems yourself? We've got an excellent team at Nucleus, a top-class Belgian hosting provider, that can help you.

Discover our Managed Hosting, where skilled engineers manage your servers and keep them up-to-date, so you can focus on your core business. We use a variety of Configuration Management Systems such as Puppet to make sure every config is reviewed, unit-tested and guaranteed to be working.

Want to get in touch? Find me as @mattiasgeniar on Twitter or via the contact-page on this blog.