How to install mcrypt for PHP 5.3.3 on CentOS 5.7 64 bit?

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

rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
yum install php53-mcrypt

The EPEL repo contains more, and more upgraded packages to compliment the default repository.


Install EPEL Repository On 32-bit CentOS Linux 5.5:

rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm

Install EPEL Repository On 64-bit CentOS Linux 5.5:

rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm

This will definitely work on CentOS/RHEL 6+ Versions.
Hope similar approach will work on 5+ versions.

rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
yum update
yum install -y php-mcrypt

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!)