Installing libapache2-mod-php7.1

17k Views Asked by At

I installed Apache 2.4.27 and PHP 7.1.7 from source, but I don't find a tip about how to install libapache2-mod-php7.1 or the required module.

How can I install libapache2-mod-php7.1 (or similar) to Apache 2 located under /user/local/apache2?

I have to install it on Debian 8.8 Jessie.

1

There are 1 best solutions below

1
On

Basically it should be installed during installation of PHP:

sudo apt-get install php7.1
...
The following NEW packages will be installed:
  libapache2-mod-php7.1 libssl1.0.2 php-common php7.1 php7.1-cli php7.1-common php7.1-json php7.1-opcache php7.1-readline

So first check if it is already installed:

dpkg -l | grep libapache2-mod-php7.1
ii  libapache2-mod-php7.1         7.1.7.retag-1+0~20170711133844.5+jessie~1.gbp5284f4 amd64        server-side, HTML-embedded scripting language (Apache 2 module)

In case it is not installed the following command should work fine:

sudo apt-get install libapache2-mod-php7.1

If it will fail check if it is available in repo:

apt-get update
apt-cache search libapache2-mod-php7.1

I used deb.sury.org for php 7.1:

apt-get install apt-transport-https ca-certificates
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ jessie main" > /etc/apt/sources.list.d/php.list
apt-get update