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 "extension=mcrypt.so" (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?


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:



  • 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! 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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