#PHP 7.0.0 Alpha 2 is already released.
And very soon we will have an stable release. So I sugest to test your code is compatible with #php7.
I’ve tested it on #Ubuntu 15.1
Firstly we need to have root premissions:
sudo su
Now we will need some dependencies to build #PHP, and we will install it with:
$ apt-get update && apt-get install -y libcurl4-openssl-dev libmcrypt-dev
\ libxml2-dev libjpeg-dev libfreetype6-dev libmysqlclient-dev
\ libt1-dev libgmp-dev libpspell-dev libicu-dev librecode-dev
Then we will navigate to our home directory and get DEB archive with php7 and unpack the archive to /usr/local/php7
$ cd ~
$ wget http://repos.zend.com/zend-server/early-access/php7/php-7.0-latest-DEB-x86_64.tar.gz
$ tar xzPf php-7*.tar.gz
Now you need to create config php-fpm.conf (use /usr/local/php7/etc/php-fpm.conf). Containing something like this, for beginning:
[global]
pid = /run/php7-fpm.pid
error_log = /var/log/php7-fpm.log
[www]
user = nginx
group = nginx
listen = 127.0.0.1:9000
pm = dynamic
pm.max_children = 10
pm.start_servers = 4
pm.min_spare_servers = 2
pm.max_spare_servers = 6
Make sure the listen config does not collide with your php5-fpm config. Change port or socket file name if needed.
Next, you need the System V init script in /etc/init.d/php7-fpm. I took the php5-fpm script from Ondřej Surý as a basis and just fixed the paths to php7-fpm.Download
$ wget -O /etc/init.d/php7-fpm "http://blog.zamiatin-web.com/wp-content/uploads/2015/06/etc-inid.d-php7-fpm.txt"
$ chmod a+x /etc/init.d/php7-fpm
Then you need the init script in /etc/init/php7-fpm. This one is also just an adaptation of Ondřej Surý’s script. Download
$ wget -O /etc/init/php7-fpm "http://blog.zamiatin-web.com/wp-content/uploads/2015/06/etc-init-php7-fpm.txt"
You also need the checkconf script. Create the file /usr/local/lib/php7-fpm-checkconf:
#!/bin/sh
set -e
errors=$(/usr/local/php7/sbin/php-fpm --fpm-config /usr/local/php7/etc/php-fpm.conf -t 2>&1 | grep “\[ERROR\]” || true);
if [ -n “$errors” ]; then
echo “Please fix your configuration file…”
echo $errors
exit 1
fi
exit 0
And make it executable:
$ chmod a+x /usr/local/lib/php7-fpm-checkconf
Make sure php7-fpm starts when your system boots:
$ update-rc.d php7-fpm defaults
Start php7-fpm
$ service php7-fpm start
Thats all folks, have fun 😉