Installing mcrypt (PHP) on AWS Linux AMI

This post was published 8 years, 6 months ago. Due to the rapidly evolving world of technology, some concepts may no longer be applicable.

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

One thought on “Installing mcrypt (PHP) on AWS Linux AMI

Leave a Reply

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