Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

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:

http://wiki.centos.org/HowTos/PHP_5.1_To_5.22

http://wiki.centos.org/HowTos/PHP_5.1_To_5.2#head-fe084db340a72a9b7b7fca8fcba57ef4e9a344851

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

 
discard

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.