Install PHP7 to Ubuntu
#!/bin/bash
#
# Instructions:
# 1: sudo chmod +x installphp7.sh
# 2: sudo ./installphp7.sh
#
apt-get update
apt-get install -y git-core\
autoconf\
bison\
libxml2-dev\
libbz2-dev\
libmcrypt-dev\
libcurl4-openssl-dev\
libltdl-dev\
libpng-dev\
libpspell-dev\
libreadline-dev
# Make two folders
mkdir -p /etc/php7/conf.d /etc/php7/cli/conf.d
# Where PHP7 is stored
mkdir /usr/local/php7
# Clone the SRC
cd /tmp
git clone https://github.com/php/php-src.git --depth=1
cd php-src
# Configure
./buildconf
./configure --prefix=/usr/local/php7\
--enable-bcmath\
--with-bz2\
--enable-calendar\
--enable-exif\
--enable-dba\
--enable-ftp\
--with-gettext\
--with-gd\
--enable-mbstring\
--with-mcrypt\
--with-mhash\
--enable-mysqlnd\
--with-mysql=mysqlnd\
--with-mysqli=mysqlnd\
--with-pdo-mysql=mysqlnd\
--with-openssl\
--enable-pcntl\
--with-pspell\
--enable-shmop\
--enable-soap\
--enable-sockets\
--enable-sysvmsg\
--enable-sysvsem\
--enable-sysvshm\
--enable-wddx\
--with-zlib\
--enable-zip\
--with-readline\
--with-curl\
--with-config-file-path=/etc/php7/cli\
--with-config-file-scan-dir=/etc/php7/cli/conf.d
make
# Uncomment this to test your make, this takes extra long.
# make test
make install