Compiling mcrypt for php

Download php installation source from http://www.php.net/.

1. tar -zxf php-5.1.6.tar.gz
2. cd to php-5.1.6/ext/mcrypt
3. phpize
4. aclocal
5. ./configure
6. make clean
7. make
8. make install
9. vi /etc/php.d/mcrypt.ini and add the following lines:

; Enable mbstring extension module
extension=mcrypt.so

10. Restart apache

Found at http://www.outofcontrol.ca/2008/04/01/installing-mcrypt-into-php5-as-a-module/