Why is Apache installed by default?

Asked by Christopher Gerber on 2016-03-11

We use a configuration management tool called Chef to build new images. We also use Nginx as our webserver. However, when installing php7 and Nginx, we run into a build failure because PHP7 automatically installs and starts the apache service. Is there any reason that it must be listed as a dependency?

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu php7.0 Edit question
Assignee:
No assignee Edit question
Last query:
2016-03-11
Last reply:
2016-05-04

I suggest you report a bug

Nish Aravamudan (nacc) said : #2

Hello, the reason apache is getting installed (I believe) is this dependency line:

  php7.0-fpm | libapache2-mod-php7.0 | php7.0-cgi

My understanding of dependency resolution, though, implies that php7.0-fpm will be selected if no specific alternative is specified.

And, in testing in a 16.04 LXC:

root@ubuntu:~# apt-get install php7.0 nginx
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  fontconfig-config fonts-dejavu-core libfontconfig1 libfreetype6 libgd3
  libjbig0 libjpeg-turbo8 libjpeg8 libtiff5 libvpx3 libxpm4 libxslt1.1
  nginx-common nginx-core php-common php7.0-cli php7.0-common php7.0-fpm
  php7.0-json php7.0-opcache php7.0-readline
Suggested packages:
  libgd-tools fcgiwrap nginx-doc ssl-cert php-pear
The following NEW packages will be installed:
  fontconfig-config fonts-dejavu-core libfontconfig1 libfreetype6 libgd3
  libjbig0 libjpeg-turbo8 libjpeg8 libtiff5 libvpx3 libxpm4 libxslt1.1 nginx
  nginx-common nginx-core php-common php7.0 php7.0-cli php7.0-common
  php7.0-fpm php7.0-json php7.0-opcache php7.0-readline
0 upgraded, 23 newly installed, 0 to remove and 20 not upgraded.
Need to get 6471 kB of archives.
After this operation, 24.4 MB of additional disk space will be used.
Do you want to continue? [Y/n]

And indeed php7.0-fpm is selected, which does not pull in Apache and the install succeeds. Are you sure you didn't just hit an issue with a not-yet-released version of php7.0?

Can you help with this problem?

Provide an answer of your own, or ask Christopher Gerber for more information if necessary.

To post a message you must log in.