Intro
Been waiting for PHP7 to come out and be available in usual Ubuntu repos but successfully ignored my ability to Google for that, xe. Finally, picked one evening and followed several how-to’s in order to set up as properly as possible php-fpm + nginx. Shortly after PHP7.1 came out and I simply could not be bothered to figure out an upgrade.
Steps to upgrade
Check current
Extra package
Not sure if it is optional
Grep current modules
Checking:
Will produce something like this:
Let’s grab the first column:
Replace PHP7.0 with PHP7.1
And what do we have?
Xdebug note
When replacing PHP7.0 with 7.1 you will lose Xdebug. Simply remove it and freshly install again. Even if it is the same version.
My additional php-fpm and nginx amendments
Since you have php installed and some sort of server (unless you purely use php built-in server), you have some amendments to do.
- php-fpm pools in
/etc/php/7.1/fpm/pool.d/*.conf
:- I consider you moved all the confs from 7.0
listen = /var/run/php/php7.1-fpm-[your-virtual-host-name].sock
- nginx sites-available in
/etc/nginx/sites-available/*
:fastcgi_pass unix:/run/php/php7.1-fpm-[your-virtual-host-name].sock;
- restart and enjoy:
sudo service php7.1-fpm stop && service php7.1-fpm start
sudo service nginx stop && service nginx start
I believe that is all I had to change if my memory serves good.