Compile php 5.5 with apache prefork support

PHPPHP 5.5 introduces new features and improves several existing ones but to make use of them in distributions such as Debian, CentOS, Ubuntu, Fedora we should compile it because at the moment in which I write this article PHP 5.5 has not been included in official repositories today LibreByte will show how to compile PHP 5.5 on Debian GNU/Linux

This procedure has been tested on Debian GNU/Linux 7 (squeeze), make the necessary modifications so that it fits to your distribution.

Download PHP 5.5

$ wget http://us1.php.net/distributions/php-5.5.15.tar.xz

Unpack PHP 5.5

$ tar xJvf php-5.5.15.tar.xz

Download and run the script to install dependencies

$ wget --no-check-certificate https://raw.githubusercontent.com/yoander/sysadmin/master/shscript/php-dev-install-dep.sh && 
chmod a+x -c php-dev-install-dep.sh && 
./php-dev-install-dep.sh

Download script to compile php

$ wget --no-check-certificate https://raw.githubusercontent.com/yoander/sysadmin/master/shscript/php-build.sh && 
chmod a+x -c php-build.sh

Compile php

$./php-build.sh -a php-5.5.15

Install

$ cd  php-5.5.15 && sudo make install

Deploy configuration file

$ sudo cp -v php.ini-development /etc/php/php.ini

Activate OpCache

$ sudo bash -c 'echo "zend_extension=opcache.so" > /etc/php/conf.d/20-opcache.ini'

Restart Apache

$ sudo service apache2 restart

Check

$ firefox http://localhost/info.php

How to compile PHP from the source code, 7 (11)

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.