Installing mcrypt (PHP) on AWS Linux AMI

Update: with the update of PHP to v5.3.3, the amzn repository now includes php-mcrypt, rendering the steps below unnecessary.

At the moment, the amzn repository has v5.3.2 of PHP (while the latest version is v5.3.3) – it also does not offer php-mcrypt. While in previous servers I have included a wider selection of repositories, I wanted to limit my repositories somewhat on this setup. The only other (disabled) repository I use is RPMForge (which also does not offer php-mcrypt).

To make the mcrypt module (requires gcc, automake, php-devel, libmcrypt (from RPMForge), and libmcrypt-devel (from RPMForge)):

sudo -i
wget http://ca.php.net/get/php-5.3.2.tar.gz/from/us.php.net/mirror
tar -xzvf php-5.3.2.tar.gz
cd php-5.3.2/ext/mcrypt
phpize
aclocal
./configure
make
make install
echo "extension=mcrypt.so" | tee /etc/php.d/mcrypt.ini
service httpd restart
exit

By cyberx86

Just a random guy who dabbles with assorted technologies yet works in a completely unrelated field.

1 comment

Leave a Reply to David Cancel reply

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