Install PHP7 on Debian 8 Jessie (with Apache)

Important:

Double check your operate system: ONLY  Debian 8 (Jessie) works with this instruction

Apache version: 2.4 which is the default version comes with Debian 8 (Not working with Apache 2.2 or lower)

Install Apache2:

Update package list and upgrade outdated packages:

Install Apache2:

Install PHP7:

Since PHP7 is not included in any Debian official source list, we gonna use the version compiled by Dotdeb.org, which is pretty widely used.

Add source:

Add the following two lines to the end of the file:

If you server is far from US, try find the nearest mirror: https://www.dotdeb.org/mirrors/

Get and Install GnuPG key:

Update packages again

Install PHP7:

here is a list of available packages currently: (By the way, Swoole also work with php7, use ‘pecl install swoole to install’)

Choose your list of mod, install with php

Install mod_php7 for Apache 2.4 and restart apache:

That’s it! Done!