Setup apache-2.4.16 + php-5.6.11 on CentOS 6.7

# Install dependencies
yum update -y
yum install -y gcc apr-devel apr-util-devel openssl-devel pcre-devel libxml2-devel libcurl-devel
mkdir setup && cd setup
tar -xvf httpd-2.4.16.tar.gz
# Download and unpack apr
cd httpd-2.4.16/srclib
tar -xvf apr-1.5.2.tar.gz
tar -xvf apr-util-1.5.4.tar.gz
mv apr-1.5.2 apr
mv apr-util-1.5.4 apr-util
cd ..
# Configure apache
./configure –enable-so –enable-ssl –with-included-apr
# Compile, link and install apache locally
make && make install
cd ..
# Get php-5.6.11 source code
tar -xvf mirror
cd php-5.6.11
# Configure build
./configure –with-apxs2=/usr/local/apache2/bin/apxs –with-mysql –with-curl –with-openssl
# Compile and install php
make && make install
# Set handler for php files
<FilesMatch “\.php$”>
SetHandler application/x-httpd-php
>> /usr/local/apache2/conf/httpd.conf
# Add test file
echo <?php phpinfo(); > /usr/local/apache2/htdocs/index.php

please make sure below thing at  /etc/httpd/conf/httpd.conf

<FilesMatch “\.php$”>
# SetHandler application/x-httpd-php

AddType application/x-httpd-php-source phps
LoadModule php5_module modules/
AddHandler php5-script .php
AddType text/html .php
DirectoryIndex index.php


Source from:


Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s