User avatar
Milliways
Posts: 570
Joined: Fri Apr 25, 2014 12:18 am
Location: Sydney, Australia

[Solved] Why does apt install php7.0 install apache

Sun Aug 27, 2017 6:50 am

I have installed nginx on my Pi3 running Raspbian Stretch.
I wanted to install php to use with nginx, but when I tried the following

Code: Select all

sudo apt install php7.0 php7.0-cli
I was informed

Code: Select all

Reading package lists... Done

The following additional packages will be installed:
  apache2 apache2-bin apache2-data apache2-utils libapache2-mod-php7.0 libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap liblua5.2-0
  php-common php7.0-common php7.0-json php7.0-opcache php7.0-readline ssl-cert
I don't want to install apache2, after all I already have nginx.
This didn't happen on Jessie (using php5).

Is this a bug or is it normal.

I suppose I could always remove apache, but this seems wasteful.
Last edited by Milliways on Sun Aug 27, 2017 7:22 am, edited 1 time in total.

User avatar
rpdom
Posts: 17548
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Why does apt install php7.0 install apache

Sun Aug 27, 2017 7:03 am

For nginx you could install php7.0-fpm instead of the php7.0 meta-package, as that will provide the same functionality. After installing php7.0-fpm you can install php7.0 (although there is no reason to do this) and it won't try to install apache as the dependency will already be met by php7.0-fpm.

php7.0 depends on at least one of libapache2-mod-php7.0, php7.0-fpm, php7.0-cgi or php7.0-common being installed, and if none of those are already installed it will choose the first one.

User avatar
Milliways
Posts: 570
Joined: Fri Apr 25, 2014 12:18 am
Location: Sydney, Australia

Re: Why does apt install php7.0 install apache

Sun Aug 27, 2017 7:22 am

Thanks, Seems to have done the job.

Return to “Raspberry Pi OS”