Install php7 from source on Ubuntu 14.04 LTS

# Install virtualbox

sudo apt-get install virtualbox
sudo apt-get install virtualbox-dkms

# Install vagrant from source (vagrant from ubuntu repo doesn´t work)

wget https://dl.bintray.com/mitchellh/vagrant/vagrant_1.7.4_i686.deb
sudo apt-get purge vagrant
sudo dpkg -i vagrant_1.7.4_i686.deb

# Install Ubuntu 14.04 LTS

vagrant init ubuntu/trusty32
vagrant up --provider virtualbox
vagrant ssh

# On Ubuntu machine

sudo apt-get install build-essential git autoconf -y
sudo apt-get build-dep php5
sudo apt-get install libt1-dev libgmp-dev bison mcrypt libmcrypt-dev -y

# fix missing gmp.h

sudo ln -s /usr/include/gmpxx.h /usr/include/gmp.h 

# Install php7 

mkdir $HOME/php7
cd $HOME/php7
git clone https://git.php.net/repository/php-src.git
cd php-src
./buildconf
./configure \
--prefix=$HOME/php7/usr \
--with-config-file-path=$HOME/php7/usr/etc \
--enable-mbstring \
--enable-zip \
--enable-bcmath \
--enable-pcntl \
--enable-ftp \
--enable-exif \
--enable-calendar \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--enable-wddx \
--with-curl \
--with-mcrypt \
--with-iconv \
--with-gmp \
--with-pspell \
--with-gd \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
--with-zlib-dir=/usr \
--with-xpm-dir=/usr \
--with-freetype-dir=/usr \
--with-t1lib=/usr \
--enable-gd-native-ttf \
--enable-gd-jis-conv \
--with-openssl \
--with-pdo-mysql=/usr \
--with-gettext=/usr \
--with-zlib=/usr \
--with-bz2=/usr \
--with-recode=/usr \
--with-mysqli=/usr/bin/mysql_config

make
make test
make install

# Make it global available
 

sudo ln -s /home/vagrant/php7/usr/bin/php /usr/bin/php
sudo ln -s /home/vagrant/php7/usr/bin/php-cgi /usr/bin/php-cgi

# References
http://jcutrer.com/howto/linux/how-to-compile-php7-on-ubuntu-14-04
http://www.zimuel.it/install-php-7/
http://www.intracto.com/nl/blog/running-symfony2-on-php7