I installed php 5.3 and some modules using
yum install php53-{module-name}
But mcrypt did not work.
I searched like this:
yum list php* | grep mcry
The only package that came up was
php-mcrypt.x86-64 5.1.6-15.e15.centos.1 extras
I have the same exact problem with mhash. The results for php are even more confusing.
I know this is probably a dumb question, but any help would be appreciated. I am used to Ubuntu's simple "apt-get install" and everything works. CentOS seems to be a lot more detail oriented.
Thanks.
EDIT: Here's what I tried:
yum install php53-mcrypt
Result:
No package php53-mcrypt available
And trying this:
yum install php-mcrypt
Results in:
Error: php53-common conflicts with php-common
Because php-mcrypt tries to get php-common as a dependency (?) and I am trying to use php 5.3 rather than the default php 5.1 on CentOS 5.7.
Is php 5.3 really necessary for what you're doing? Don't automatically assume newer is better.
If you upgrade to CentOS 6 php 5.3 is the default.
What you have to understand is RedHat (and thus its clones) is very conservative about upgrading packages with good reason. If you want the to push it and get more upgraded packages, expect problems.
That said, the package you are looking for exists! All you need to do is
The EPEL repo contains more, and more upgraded packages to compliment the default repository.
Install EPEL Repository On 32-bit CentOS Linux 5.5:
Install EPEL Repository On 64-bit CentOS Linux 5.5:
This will definitely work on CentOS/RHEL 6+ Versions.
Hope similar approach will work on 5+ versions.
Since people are still coming here, I'm going to throw in an answer I haven't seen yet.
I run CentOS but I also need to keep current with PHP and MySQL, with later versions than Red Hat chooses to provide. To solve this problem, I use the remi repository, which provides current packages of PHP, MySQL, Symfony and a few other things for CentOS.
(And I just decommissioned the last CentOS 5 box less than an hour ago, hooray!)
Initially, find out what version of PHP you are using:
Find the appropriate RPM package on http://rpmfind.net/linux/rpm2html/search.php?query=php-mcrypt (match your PHP version and CPU architecture)
For me it was ftp://rpmfind.net/linux/epel/6/x86_64/php-mcrypt-5.3.3-1.el6.x86_64.rpm
This completes the installation:
Check
php -v
for errors.Looks like you'll have to compile it yourself, as there doesn't seem to be an mcrypt RPM for php-5.3 on CentOS5.
Take a look at this on how to do the compile:
http://chrisjean.com/2011/06/24/upgrade-php-5-1-or-5-2-to-5-3-on-centos/
Note that this will take you out of package management for mcrypt and pear, if that's important.