Home > Linux, PHP > Installing mcrypt for PHP 5.3 on CentOS 5.6

Installing mcrypt for PHP 5.3 on CentOS 5.6

October 23rd, 2011 Leave a comment Go to comments

With CentOS 5.6 Red Hat added an optional php53 package for those that need a PHP version later than 5.1.6. After removing the php packages and installing php53 you will probably notice that the mcrypt extension is missing. With a few steps we can compile and install this extension.

yum install php53-devel libmcrypt-devel gcc
wget http://vault.centos.org/5.6/updates/SRPMS/php53-5.3.3-1.el5_6.1.src.rpm
mkdir /usr/src/redhat
rpm -i php53-5.3.3-1.el5_6.1.src.rpm
cd /usr/src/redhat/SOURCES
bunzip2 php-5.3.3.tar.bz2
tar xf php-5.3.3.tar
cd php-5.3.3/ext/mcrypt
make install
echo "extension=mcrypt.so" > /etc/php.d/mcrypt.ini
service httpd restart

Categories: Linux, PHP Tags: ,
  1. March 13th, 2012 at 04:53 | #1

    Thank you very much. This worked very well for me. Perfect!!!

  2. March 16th, 2012 at 12:05 | #2

    This was easy!! So much other crap on the interweb that complicated this situation. One guy led me to a centos bug page saying that it cannot be fixed. Thanks!

  3. dave
    March 24th, 2012 at 20:57 | #3

    Works great. Thank you so much.

  4. josh
    April 2nd, 2012 at 14:09 | #4

    That really simplified the last few hours of Googling. Nice and concise, worked like a charm. Thanks so much.

  5. April 15th, 2012 at 21:11 | #5

    I did this and it worked. The question I have is if php updates or there is a vulnerability in mcrypt do you get patch or are you stuck to 5.3.3-1?

  1. No trackbacks yet.