Installing Libmcrypt on a Godaddy Virtual Dedicated Server
Friday, July 11th, 2008We recently deployed a web site using GoDaddy’s virtual dedicated server. Everything about the default PHP installation was fine, except that libmcrypt was not available. When I asked the godaddy support staff “How do we enable libmcrypt for PHP?” their response was far from helpful:
Thank you for contacting Server Support. Unfortunately 3rd party installations and configurations are not supported.
Rather than argue with the support team about what constitutes a 3rd party installation, I decided to google around and see if I could do it myself. Hours later, I succeeded. Here are the steps for installing libmcrypt:
- su root
- yum install gcc-c++
- yum install lex
- yum install libxml2
- yum install libxml2-devel
- yum install flex
- wget http://downloads.sourceforge.net/mcrypt/libmcrypt-2.5.8.tar.gz?modtime=1171868460&big_mirror=0
- tar -xzvf libmcrypt-2.5.8.tar.gz
- cd libmcrypt-2.5.8
- ./configure
- make
- make install
- wget http://museum.php.net/php5/php-5.1.6.tar.gz
- tar -xzvf php-5.1.6.tar.gz
- cd php-5.1.6
- ./configure –with-mcrypt=shared,/usr/local/lib
- make (after running ‘make’, DO NOT RUN ‘make install’)
- cp modules/mcrypt.so /usr/lib/php/modules/
- Add a file /etc/php.d/mcrypt.ini
; Enable mcrypt extension module
extension=mcrypt.so - /usr/sbin/apachectl restart
That’s it! To confirm a successful install, just run phpinfo() and look for the mcrypt section
