Debian 8 - Install PHP 7.1

Using Ondrej Sury

The easiest way to install PHP 7.1 is to use prog-exec.

prog-exec "23/2" "2649c263665a6224262882b6abb46ad49cc6935654e56a62a1cdfb70c353b02e"

Alternatively, you can copy and paste the following script, which is what the previous command downloads and executes.

#!/bin/bash
sudo apt update
sudo apt install apt-transport-https lsb-release ca-certificates -y

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

echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" |
sudo tee /etc/apt/sources.list.d/php.list

sudo apt update
sudo apt install php7.1 -y

This script is a derived from the the source in the references section, but I have a strong reason to believe was also grabbed from Ondrej.

Compile From source

If you don't feel like placing your trust in Ondrej, then you may want to compile from source. At the time of writing this post, the current version of the 7.1 line is 7.1.0 which can be found here. One day I will fill in this section with a script for compiling from source, but for now you can refer to Brandonsavage.net - Compiling PHP 5.5 From Scratch.

References

Author

Programster

Stuart is a software developer with a passion for Linux and open source projects.

comments powered by Disqus
We are a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for us to earn fees by linking to Amazon.com and affiliated sites. More info.