1) Install APR 1.5.1
cd /tmp/apache-build/apr-1.5.1 make distclean ./configure make make install
2) Install APR-UTIL 1.5.3
cd /tmp/apache-build/apr-util-1.5.3 make distclean ./configure --with-apr=/usr/local/apr/ make make install
3) Install Apache 2.2
cd /tmp/apache-build/httpd-2.2.27 rm -rf /usr/local/apache/conf/httpd.conf make distclean ./configure --enable-so --prefix=/usr/local/apache --with-mpm=prefork --enable-ssl --enable-unique-id --enable-ssl=/usr/include/openssl --enable-rewrite --enable-deflate --enable-suexec --with-suexec-docroot="/home" --with-suexec-caller="nobody" --with-suexec-logfile="/usr/local/apache/logs/suexec_log" --enable-asis --enable-filter --with-pcre --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr --enable-headers --enable-expires --enable-proxy --enable-cgi --enable-rewrite --enable-speling make && make install echo "Include /usr/local/apache/conf/sharedip.conf" >> /usr/local/apache/conf/httpd.conf echo "Include /usr/local/apache/conf.d/*.conf" >> /usr/local/apache/conf/httpd.conf sed -i "s|DirectoryIndex index.html|DirectoryIndex index.php index.html|g" /usr/local/apache/conf/httpd.conf mv /usr/local/apache/conf.d/suphp.conf /usr/local/apache/conf/suphp.conf
4) Install php5.4
cd /tmp/php-build/php-5.4.27 make distclean ./configure --with-apxs2=/usr/local/apache/bin/apxs --with-zlib --enable-soap --enable-exif --with-config-file-path=/usr/local/php --with-config-file-scan-dir=/usr/local/php/php.d --enable-phar --enable-bcmath --enable-calendar --with-curl --with-iconv --with-mysql --with-mysqli --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-mcrypt --with-gettext --with-xsl --with-xmlrpc --with-pdo-mysql=mysqlnd --enable-posix --enable-ftp --with-openssl --enable-mbstring --with-jpeg-dir=/usr --with-freetype-dir=/usr --with-kerberos --with-xsl --with-bz2 --enable-sockets --enable-zip --with-gd --enable-sockets --with-pcre-regex --libdir=/usr/lib64 --disable-cgi --with-mysql-sock=/var/lib/mysql/mysql.sock make && make install rm -rf /usr/local/php/php.ini cp php.ini-production /usr/local/php/php.ini sed -i "s|.*modules/libphp5.so.*||g" /usr/local/apache/conf/httpd.conf
5) Create php.conf to load into Apache
wget --output-document="/usr/local/apache/conf.d/php.conf" http://dl-package.bullten.in/cwp/files/dso/php.txt
6) Restart Apache.
service httpd restart
You need to chmod 755 public_html for DSO to work else you will be getting forbidden error.
chmod 755 /home/user/public_html