Seguindo os passos abaixo você vai conseguir a instalar com sucesso um servidor web com Apache 2.4 e PHP 5.6.

  • Crie um diretorio em mkdir -p /home/<usuario>/apache-php/
  • Faça o download do Apache2 com o comando curl -o httpd-2.4.12.tar.gz http://archive.apache.org/dist/httpd/httpd-2.4.12.tar.gz
  • Faça o Download do PHP com o comando curl -o php-5.6.6.tar.gz http://br1.php.net/distributions/php-5.6.6.tar.gz
  • Descompacte o Apache2 tar -xvzf httpd-2.4.12.tar.gz
  • Descompacte o PHP tar -xvzf php-5.6.6.tar.gz
  • Instale as dependências para o Apache2.4
apt-get install libapr1 libapr1-dev \
    libaprutil1 libaprutil1-dev liblua5.1-0-dev
  • Acesso o diretório com cd httpd-2.4.12
  • Agora compile o Apache2.4:
./configure –prefix=/usr/local/apache2 –enable-so \
    –enable-cgi –enable-info –enable-rewrite \
    –enable-speling –enable-usertrack –enable-deflate \
    –enable-ssl –enable-mime-magic –enable-pcre-jit \
    –enable-cache-lua –enable-request-early –with-libxml2
make
make install
  • Instalar os clients de MySQL e PHP:
apt-get install libmysql++-dev \
    libmysqlclient-dev libmysqld-dev
  • Instalar as dependências do PHP:
apt-get install libxml2 libxml2-dev libxml2-utils \
    libpng12-dev  libjpeg62-dev libpng3 libpng3 libjpeg8 libpng12-dev
  • Acesse o diretório do PHP cd php-5.6.6
  • Agora compile o PHP 5.6:
./configure –with-apxs2=/usr/local/apache2/bin/apxs \
    –with-zlib –with-gettext –with-mysql –with-gd  \
    –enable-mbstring –with-pdo-mysql –with-mysqli \
    –with-png-dir=/usr/lib/x86_64-linux-gnu/ \
    –enable-zip –with-jpeg-dir=/usr/lib/x86_64-linux-gnu/ \
    –prefix=/usr/local/apache2/php 
    –with-config-file-path=/usr/local/apache2/php
make
make install