oerdnj / deb.sury.org

Public bugreports for anything ppa:ondrej/*
812 stars 27 forks source link

Wants to install apache2 while lighttpd is installed already #1533

Open OlafvdSpek opened 3 years ago

OlafvdSpek commented 3 years ago

This seems undesirable...

Debian 10.8

# apt update
...
20 packages can be upgraded. Run 'apt list --upgradable' to see them.

# apt upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following NEW packages will be installed:
  apache2 apache2-bin apache2-data apache2-utils libapache2-mod-php8.0 libaprutil1-dbd-sqlite3 libaprutil1-ldap libbrotli1 libjansson4 liblua5.2-0 php8.0 php8.0-cli php8.0-common php8.0-curl php8.0-fpm php8.0-gd php8.0-mbstring php8.0-mysql
  php8.0-opcache php8.0-readline
The following packages will be upgraded:
  google-cloud-sdk libpcre2-8-0 php php-common php-curl php-fpm php-gd php-mbstring php-mysql php7.4 php7.4-cli php7.4-common php7.4-curl php7.4-fpm php7.4-gd php7.4-json php7.4-mbstring php7.4-mysql php7.4-opcache php7.4-readline
20 upgraded, 20 newly installed, 0 to remove and 0 not upgraded.
Need to get 105 MB of archives.
After this operation, 33.1 MB of additional disk space will be used.
Do you want to continue? [Y/n] n
Abort.
# 
oerdnj commented 3 years ago

I haven't really found a solution for this yet - the php package pulls php8.0 which pulls one of the web SAPIs and libapache2-mod-php8.0 is first on the list, so it gets picked up by apt dependency solver.

I would be happy to hear any ideas how to solve this without breaking any other expectations. Even if I changed the order to have php8.0-fpm or php8.0-cgi as a first SAPI on the list, I would get the other kind of bugreports about php8.0-fpm being installed while they are running apache2.

Perhaps simply dropping php and phpX.Y packages might be best solution?

OlafvdSpek commented 3 years ago

Doesn't Apache support FPM yet? Prefering fpm over libapache2-mod-php8.0 would be good for me, but as you said maybe not for others. At least it wouldn't install a web server... Apt's resolver seems sub-optimal as well, as it's installing php8.0-fpm anyway. Do other packages depend on php or on php-common? Wouldn't the same problem occur with php-common?

oerdnj commented 3 years ago

Yes, Apache2 does support FPM.

I think php-common pulls only php-cli, so no not really.

Dropping php would be also suboptimal as there are packages that doesn't require a specific webserver, but they need web enabled SAPI:

$ grep-dctrl -F Depends php, -s Package /var/lib/apt/lists/*Packages | sort -u
Package: adminer
Package: cacti
Package: dokuwiki
Package: dtc-common
Package: fusiondirectory
Package: ganglia-webfrontend
Package: gosa
Package: homer-api
Package: hoteldruid
Package: icingaweb2-module-businessprocess
Package: icingaweb2-module-director
Package: libsoup2.4-tests
Package: loganalyzer
Package: nagvis
Package: oar-web-status
Package: ocsinventory-reports
Package: openstack-cluster-installer
Package: php-cas
Package: phpldapadmin
Package: phpqrcode
Package: postfixadmin
Package: simplesamlphp
Package: slbackup-php
Package: wordpress
Package: zabbix-frontend-php
Package: zoph

I would be happy if we found a solution to this, but so far I'm like 🤷

OlafvdSpek commented 3 years ago

What about a virtual php package? -fpm and libapache2-mod- would provide it, but as it's virtual apt wouldn't install it automatically. Or maybe it would.. Maybe apt maintainers could be asked for advice?

BTW, I don't see phpmyadmin in that list, did they solve it differently?

oerdnj commented 3 years ago

Maybe apt maintainers could be asked for advice?

I would appreciate if you could do that.

BTW, I don't see phpmyadmin in that list, did they solve it differently?

I think they pull it via transitive dependency, the Depends list contains quite a lot of different php dependencies.

OlafvdSpek commented 3 years ago

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=982797

sirocyl commented 5 months ago

I've observed this same issue (or a very similar one, with likely the same fix), with nginx. Upstream seems to have fixed the issue pointed out in the comment above mine.

Steps to reproduce:

Note that it upgrades php-fpm to the latest on the repo, and tries to install, presumably one of php-8.3 or php as a dependency or upgrade - which now tries to drag in apache2 as a dependency.

Log from the attempted repo add and upgrade: ``` ttrue@styx-srv:~$ sudo dpkg -i /tmp/debsuryorg-archive-keyring.deb [...] ttrue@styx-srv:~$ sudo sh -c 'echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list' ttrue@styx-srv:~$ sudo apt update [...] 24 packages can be upgraded. Run 'apt list --upgradable' to see them. ttrue@styx-srv:~$ sudo apt upgrade [...] Calculating upgrade... Done The following packages were automatically installed and are no longer required: php8.2 php8.2-apcu php8.2-cli php8.2-curl php8.2-fpm php8.2-mbstring php8.2-mysql php8.2-opcache php8.2-xml php8.2-zip python3-cliapp python3-markdown python3-ttystatus Use 'sudo apt autoremove' to remove them. The following NEW packages will be installed: apache2 apache2-bin apache2-data apache2-utils libapache2-mod-php8.3 libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap liblua5.3-0 php8.3 php8.3-apcu php8.3-cli php8.3-common php8.3-curl php8.3-fpm php8.3-gd php8.3-mbstring php8.3-mysql php8.3-opcache php8.3-phpdbg php8.3-readline php8.3-xml php8.3-zip The following packages will be upgraded: php php-apcu php-cli php-common php-curl php-fpm php-gd php-mbstring php-mysql php-xml php-zip php8.2 php8.2-apcu php8.2-cli php8.2-common php8.2-curl php8.2-fpm php8.2-gd php8.2-mbstring php8.2-mysql php8.2-opcache php8.2-readline php8.2-xml php8.2-zip 24 upgraded, 24 newly installed, 0 to remove and 0 not upgraded. ```
sirocyl commented 5 months ago

The working workaround for me, is to:

It is important to install php-fpm first! for each new version (including minor version upgrades, which have a new package name and supersede the prior in upgrade) before any other PHP packages upgrades or installs, otherwise Apache will be installed and configured. It sucks that this is a two-step procedure now, but it is how it is.

It is also important, if you have (an) existing PHP install(s), that after adding the repo and key, and doing the first apt update, that you install/upgrade the corresponding php-fpm versions for your version of PHP first, before running the general apt upgrade or installing or upgrading other PHP packages.

@OlafvdSpek does following this order of operations help keep Apache at bay on your end?

OlafvdSpek commented 5 months ago

I think it does, but that's what I call a workaround, not a solution.

sirocyl commented 5 months ago

I don't disagree, I'll change that wording.