Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've created a fresh installation of CentOS 5.6, and installed PHP 5.3 using the php53-* packages from the CentOS repository. Specifically, I've got:

  • php53
  • php53-cli
  • php53-common
  • php53-devel
  • php53-mysql
  • php53-pdo
  • php53-xml

However, I also need to install the mcrypt and apc extensions for my application. CentOS has a pre-built php-mcrypt package, but there is no equivalent php53-mcrypt. The installation of APC requires pecl which I would normally install (for 5.1) with the php-pear package, but likewise there doesn't seem to be a php53-pear package.

How do I build these?

Edit It looks like the php-pear package works with php53, so I managed to get APC installed properly. I still have a problem with mcrypt because it's not installable via pecl; it's only part of the core PHP build.

share|improve this question
up vote 5 down vote accepted

You can compile and install manually only the mcrypt extension. This is what I did in my CentOS 5.6 VPS:

First install some required packages:

yum install php53-devel libmcrypt-devel gcc gcc-c++

Then download the php 5.3.6 source code from and unpack it:

tar xvjf php-5.3.6.tar.bz2

(Please note that the download link will change with every subsequent PHP release.)

Go to the directory with the mcrypt extension source code and compile:

cd php-5.3.6/ext/mcrypt/

Then install:

make install

Create the configuration file for PHP /etc/php.d/mcrypt.ini containing:

Restart apache:

/etc/init.d/httpd restart

Create a file with phpinfo just to check if the extension was loaded:

share|improve this answer

Regarding the php-pear package:

This problem should be solved with RHEL in order to be solved in CentOS, here is the bug report about that problem: PHP53 Lacks php53-pear

Install the older php-pear via yum install php-pear and than run the following commands:

pear upgrade --force Console_Getopt
pear upgrade --force pear
pear upgrade-all

(It seems that these commands will solve the issue, it worked for labradort from the linked bug report and it worked for me)

share|improve this answer

You can also get php53-mcrypt and a few other missing packages by adding the EPEL repository from to your system.

share|improve this answer

install php53-mcrypt from the redhad/fedora repo for version5, has an epl5 version :)

share|improve this answer
Answers that are little more than links aren't good answers. Can you add some more explanation. – ChrisF Jan 28 '13 at 23:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.