Howto: Install Apache 2.2.x and PHP 5.3.x on CentOS 5

Assume that you do not want to spend money on your server to have a control panel and having minimal requirement for your website,

1. Install the required packages,

yum install bison flex gcc db4 db4-devel libxml2-devel libpng-devel mysql-devel make

2. Download Apache source (refer the latest one from


3. Download PHP source (refer the latest one from


4. Build the Apache,

tar zxvf httpd-2.2.21.tar.gz
cd httpd-2.2.21
./configure --enable-so --enable-rewrite=shared
make install
cd ..

5. Build the PHP,

tar zxvf php-5.3.8.tar.gz
cd ../php-5.3.8
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --enable-bcmath \
--enable-ftp --enable-magic-quotes --with-pear --enable-sockets --with-zlib --with-gd
make install
cp php.ini-production /usr/local/lib/php.ini
cd ..

6. Now, start the Apache services,

/usr/local/apache2/bin/apachectl start

Published by

Mick Genie

Mick Genie is the founder of and working at ExaBytes Network Sdn Bhd and WPWebHost web host company. He is expertise in Windows and Linux environment especially web hosting related information, tips and trick as well as the IT Information.

2 thoughts on “Howto: Install Apache 2.2.x and PHP 5.3.x on CentOS 5”

  1. This is a great tutorial but I have a error when want to build the apache,after i write ./configure –enable-so –enable-rewrite=shared ,it show the error :

    checking for chosen layout… Apache
    checking for working mkdir -p… yes
    checking for grep that handles long lines and -e… /bin/grep
    checking for egrep… /bin/grep -E
    checking build system type… i686-pc-linux-gnu
    checking host system type… i686-pc-linux-gnu
    checking target system type… i686-pc-linux-gnu
    configure: Configuring Apache Portable Runtime library…
    checking for APR… no
    configure: error: APR not found. Please read the documentation.

    please help me ..

Comments are closed.