I'm trying to install WordPress + LEMP on my Ubuntu 18.04. I have no interest in installing Apache. Why does the PHP installer assume I do?
I'm trying to install WordPress + LEMP on my Ubuntu 18.04. I have no interest in installing Apache. Why does the PHP installer assume I do?
According to this answer on AskUbuntu: How to install php without Apache webserver?:
If you're using nginx, you probably want:
As an alternative to the approach used in this answer in which you tell APT which dependency you do want, you can also specify which you don't want. For example in Ubuntu 20.04 (the method is still valid in 18.04 for
php7.2
), to display the dependencies for thephp7.3
package (irrelevant lines omitted):The | symbol means "or" and is telling you that the dependency can be satisfied by either
libapache2-mod-php7.3
,php7.3-fpm
orphp7.3-cgi
.If we go ahead and install the package, we can see that APT will choose the first dependency from the list (
libapache2-mod-php7.3
):If you're not happy with that, you can tell APT that you do not want that dependency by placing a hyphen after the name of the unwanted package. If you do so, then APT will instead choose the second dependency from the list (
php7.3-fpm
):This approach is useful if you know you don't want a particular dependency but are indifferent as to which of the alternatives is used. On the other hand, if you know you need a specific one, use the method in the other answer.