Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to install php-mcrypt on a CentOS 5.4 but while the extensions appears to be installed, there's nothing about it when I do a phpinfo().

For example, you can see below that php-mcrypt appears to be installed properly:

[root@... ~]# rpm -qi php-mcrypt | grep Version
Version     : 5.1.6                             Vendor: CentOS
[root@... ~]# rpm -qi libmcrypt | grep Version
Version     : 2.5.8                             Vendor: CentOS

I've tried uninstalling and re-installing it with no luck. When I do a phpinfo(), it lists "/etc/php.d/mcrypt.ini" in the "additional ini files parsed" section, but there's no mention of the mcrypt extension anywhere else. The mcrypt.ini file contains the single line "" (not commented out).

When I run php -v I get the following:

PHP 5.2.6 (cli) (built: May  5 2008 10:32:59)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
    with eAccelerator v0.9.5.3, Copyright (c) 2004-2006 eAccelerator, by eAccelerator

There's no errors related to not being able to load the extension (my PHP version is 5.2.6 but if you see the php-mcrypt version above, it says "5.1.6" I'm not sure if that's incorrect of it's just a coincidence, but I would have expected an error when running php if it the version of the extension was incorrect).

Obviously, I've restarted apache since installing mcrypt, but that doesn't make a difference either.

I can't think of anything else that I could be missing... does anybody have any ideas?

share|improve this question
up vote 3 down vote accepted

You're on the right track, the problem is the PHP package version vs. the php-mcrypt version---so you'll need to upgrade php-mcrypt to 5.2.6.

There's more detailed instructions on the 5.1.6->5.2.6 process at:

share|improve this answer
Yes! This was it! The server is one I inherited and it looks like whoever was administering it before me must've upgraded PHP and forgot mcrypt or something... thanks! – Dean Harding Feb 11 '11 at 10:16

Try a "php -m" this will normally list the installed modules, but also display warnings/errors about modules it is having trouble with.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.