Install mcrypt extension for php53 in CentOS 5.6

Posted: July 7, 2011 in Linux, PHP
Tags: , , ,

I am trying out magento in my CentOS 5.6. The php minimum requirement is 5.2 and CentOS 5.6 adds php53 as a php replacement, which is not installed by default.

To install php53, remove the installed php5.1 first.

yum -y remove php*

Install php53 and some common extensions.

yum -y install php53 php53-mysql php53-xml php53-gd

When I tried to install php53-mcrypt, it returned that package not available, so I must build it by myself.

Install php53-devel and libmcrypt-devel first. You need add rpmforge repository and you can refer to this post.

yum -y install php53-devel libmcrypt-devel

Download the php 5.3.3 source code from php.net.

cd /the/path/to/php5.3.3/ext/mcyrpt/
phpize
aclocal
./configure
make
make install

Next add the following line to php.ini

extension=mcrypt.so

Restart your apache

Advertisements
Comments
  1. Tharanga says:

    Thanks. It worked.
    just copy mcrypt.so from /the/path/to/php5.3.*/ext/mcyrpt/modules to actual php modules directory after compiling mcrypt.

  2. Alex says:

    Can someone point me to the right link for php5.3.3 on php.net?

  3. […] follow the similar way in Installing mcrypt to install it yourself. Make sure you change the last step to the below in […]

  4. […] follow the similar way in Installing mcrypt to install it yourself. Make sure you change the last step to the below in […]

  5. […] follow the similar way in Installing mcrypt to install it yourself. Make sure you change the last step to the below in […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s