Artisan Développeur

Qualité, amélioration continue, agilité, professionnalisme.

install php 7.1 on debian 9.4

Hi !

Here the solution that has work for me, I found others tutorials but I had to execute a few more step to complete the setup as I want.

First, the repository, thanks to https://deb.sury.org/, the readme file is here https://packages.sury.org/php/README.txt

Based on that:

wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg

sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'

apt-get update

As a precision, the link for the lsb_release command man page, it is useful to get the name of your current distribution, try it on a terminal:

lsb_release -sc

In my case, I only want one PHP version, I don’t want to keep the 7.0, I just want have the 7.1 as default, to do that you need to install the new, remove the old without forgetting the apache module.

apt-get install php7.1
apt-get remove php7.0

apt-get remove libapache2-mod-php7.0

The php7.1 module is already installed as dependency of php7.1.

And if you need it you can do

dpkg-reconfigure libapache2-mod-php7.1

Now you have php7.1 running 😉

You may want to clean more for production, but I do not cover this here, I do this on my dev env

 

Leave a reply

Your email address will not be published.

Ce site utilise Akismet pour réduire les indésirables. En savoir plus sur comment les données de vos commentaires sont utilisées.