how to install php53-mcrypt on centos

Summary: Some time we have missing extensions of php for specific applications and we need to install and configure the extra extension manually. In this post i install php53-mcrypt on centos.

when you are facing the issue of conflict then these steps will help you to resolve the issue.
First install some required packages:

yum install php53-devel libmcrypt-devel gcc gcc-c++

Then download the php 5.3.6 source code from php.net and unpack it:

wget http://mx2.php.net/get/php-5.3.6.tar.bz2/from/us3.php.net/mirror
tar xvjf php-5.3.6.tar.bz2

(Please note that the download link will change with every subsequent PHP release.)
Go to the directory with the mcrypt extension source code and compile:

cd php-5.3.6/ext/mcrypt/
phpize
aclocal
./configure
make

Then install:

make install

Create the configuration file for PHP /etc/php.d/mcrypt.ini containing:

extension=mcrypt.so

Now restart your web server, here mine is apache apache:

/etc/init.d/httpd restart

Create a file with phpinfo just to check if the extension was loaded:

vim /var/www/html/myphp.php

phpinfo();
?>

Open your browser and access the link and find the extentions. It will be there.

Leave a Reply

Your email address will not be published. Required fields are marked *