php5.6, php7 on ubuntu14 via phpbrew

Installation procedure for php5.6 (officel release) and php7 (alpha) on Ubuntu 14.04, via
phpbrew package.

Install requirements for phpbrew:
apt-get update
apt-get upgrade
apt-get build-dep php5
apt-get install php5 php5-dev php-pear autoconf automake curl build-essential libxslt1-dev re2c libxml2 libxml2-dev php5-cli bison libbz2-dev libreadline-dev
apt-get install libfreetype6 libfreetype6-dev libpng12-0 libpng12-dev libjpeg-dev libjpeg8-dev libjpeg8 libgd-dev libgd3 libxpm4 libltdl7 libltdl-dev

[optional / in some cases already exists]
apt-get install libssl-dev openssl
apt-get install gettext libgettextpo-dev libgettextpo0
apt-get install php5-cli
apt-get install libmcrypt-dev
apt-get install libreadline-dev

Install phpbrew
curl -L -O
chmod +x phpbrew
sudo mv phpbrew /usr/bin/phpbrew

Initialise phpbrew, update
phpbrew init
phpbrew known --update
phpbrew update
phpbrew self-update

List supported versions, install php 5.6
phpbrew known
phpbrew install 5.6.10 +default

Switch the default PHP version to 5.6.10
phpbrew switch 5.6.10

Install php-7, currently Alpha
phpbrew install next as php-7.0.0
phpbrew use php-7.0.0


I often use Virtualmin, so after PHP is compiled, let’s tell Virtualmin that it’s available to use.

Virtualmin looks for additional PHPs in a specific place so we have to do some symlinking to ensure it finds our PHPBrew installed PHP.
sudo mkdir /opt/rh/
sudo ln -s /root/.phpbrew/php/php-5.6.10/ /opt/rh/php56

Re-Check Configuration, and you get something like: The following PHP versions are available : 5.5.9 (/usr/bin/php5-cgi), 5.6.10 (/opt/rh/php56/bin/php-cgi)


This entry was posted in Hosting, Informacione tehnologije, Internet, Linux and tagged , , , , . Bookmark the permalink.

6 Responses to php5.6, php7 on ubuntu14 via phpbrew

Leave a Reply

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.