mcrypt installation on php5.3.x

If you want to install PHP-mcrypt extension with PHP 5.3.3 or PHP 5.3.x version then follow the below simple steps ::

 [email protected][#] yum install php-devel libmcrypt libmcrypt-devel gcc gcc-c++
 or
 [email protected][#] yum install php53-devel libmcrypt libmcrypt-devel gcc gcc-c++
 [email protected][#] cd /usr/local/src/
 [email protected][#] wget http://museum.php.net/php5/php-5.3.3.tar.gz
 [email protected][#] tar -zxvf php-5.3.3.tar.gz
 [email protected][#] cd php-5.3.3/ext/mcrypt/
 [email protected][#] phpize
 [email protected][#] aclocal
 [email protected][#] ./configure
 [email protected][#] make
 [email protected][#] make test
 [email protected][#] make install


This will install mcrypt and to enable it, create a file mcrypt.ini in /etc/php.d/ directory

 [email protected][#] vi /etc/php.d/mcrypt.ini
 add the line
 extension=mcrypt.so
 :wq!

save and quit

finally restart httpd service.

 [email protected][#] /etc/init.d/httpd restart

Note :: If you come across the below errors while executing aclocal

 configure.in:8: warning: LT_AC_PROG_SED is m4_require'd but is not m4_defun'd
 configure.in:8: LT_AC_PROG_SED is required by...
 acinclude.m4:2683: PHP_CONFIG_NICE is expanded from...
 configure.in:8: the top level

then follow the below steps ::

 [email protected][#] cd /usr/share/aclocal
 [email protected][#] ln -s /usr/lib/php/build/ltmain.sh ltmain.sh
 [email protected] [#] ln -s /usr/lib/php/build/libtool.m4 libtool.m4

or install libtool

[email protected][#] yum install libtool

That’s all.