Skip to content

Instantly share code, notes, and snippets.



Last active Dec 21, 2016
What would you like to do?
Setup apache-2.4.4 + php-5.5.0 on CentOS 6.3
#!/usr/bin/env bash
# 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.4.tar.gz
# Download and unpack apr
cd httpd-2.4.4/srclib
tar -xvf apr-1.4.8.tar.gz
tar -xvf apr-util-1.5.2.tar.gz
mv apr-1.4.8 apr
mv apr-util-1.5.2 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.5.0 source code
tar -xvf php-5.5.0.tar.gz
cd php-5.5.0
# 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
echo '
<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

This comment has been minimized.

Copy link

@photogirish photogirish commented Feb 24, 2014

I did have to make a few tweaks because some of the wgets sources are unavailable but I still believe this is the best set of instructions I've found.

Thank you so much for sharing this.



This comment has been minimized.

Copy link

@frangeris frangeris commented Mar 27, 2014

Very useful...!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.