Error while reinstalling LAMP stack

Hello,

I have an error during the reinstallation of the lamp stack. (I uninstalled it to receive clean config files again after messing up).
The error shows up, when dietpi-software tries to enable the php7.4-fpm module, saying that it does not exist.
Any advice would be very helpfull :slight_smile:

Kind regards
Andi

Reference code for report: a878e14b-1595-4fec-83f5-58c01bca5cb5

1 Like

Pls share the full log / error message.

#### Details:
- Date           | Sun Feb 27 18:52:58 CET 2022
- DietPi version | v8.1.2 (MichaIng/master)
- Image creator  | DietPi Core Team
- Pre-image      | from scratch
- Hardware       | RPi 4 Model B (armv7l) (ID=4)
- Kernel version | `Linux DietPi 5.10.92-v7l+ #1514 SMP Mon Jan 17 17:38:03 GMT 2022 armv7l GNU/Linux`
- Distro         | bullseye (ID=6,RASPBIAN=0)
- Command        | `a2enconf php7.4-fpm`
- Exit code      | 1
2. ...
#### Expected behaviour:
<!-- What SHOULD happen? -->
- ...
#### Actual behaviour:
<!-- What IS happening? -->
- ...
#### Extra details:
<!-- Please post any extra details that might help solve the issue -->
- ...
#### Additional logs:

ERROR: Conf php7.4-fpm does not exist!

Try

apt install php7.4-fpm

And start your installation again

This says, “php7.4-fpm ist schon die neueste Version (7.4.28-1+deb11u1)” (is already the newest version).

apt install --reinstall php7.4-fpm

not working either :frowning:

root@DietPi:~# a2enconf php7.4-fpm
ERROR: Conf php7.4-fpm does not exist!
root@DietPi:~# apt install --reinstall php7.4-fpm
Paketlisten werden gelesen… Fertig
Abhängigkeitsbaum wird aufgebaut… Fertig
Statusinformationen werden eingelesen… Fertig
0 aktualisiert, 0 neu installiert, 1 erneut installiert, 0 zu entfernen und 0 nicht aktualisiert.
Es müssen noch 0 B von 1.204 kB an Archiven heruntergeladen werden.
Nach dieser Operation werden 0 B Plattenplatz zusätzlich benutzt.
debconf: delaying package configuration, since apt-utils is not installed
(Lese Datenbank ... 71647 Dateien und Verzeichnisse sind derzeit installiert.)
Vorbereitung zum Entpacken von .../php7.4-fpm_7.4.28-1+deb11u1_armhf.deb ...
Entpacken von php7.4-fpm (7.4.28-1+deb11u1) über (7.4.28-1+deb11u1) ...
php7.4-fpm (7.4.28-1+deb11u1) wird eingerichtet ...
NOTICE: Not enabling PHP 7.4 FPM by default.
NOTICE: To enable PHP 7.4 FPM in Apache2 do:
NOTICE: a2enmod proxy_fcgi setenvif
NOTICE: a2enconf php7.4-fpm
NOTICE: You are seeing this message because you have apache2 package installed.
Trigger für php7.4-fpm (7.4.28-1+deb11u1) werden verarbeitet ...
NOTICE: Not enabling PHP 7.4 FPM by default.
NOTICE: To enable PHP 7.4 FPM in Apache2 do:
NOTICE: a2enmod proxy_fcgi setenvif
NOTICE: a2enconf php7.4-fpm
NOTICE: You are seeing this message because you have apache2 package installed.
root@DietPi:~# a2enmod proxy_fcgi setenvif
Considering dependency proxy for proxy_fcgi:
Module proxy already enabled
Module proxy_fcgi already enabled
Module setenvif already enabled
root@DietPi:~# a2enconf php7.4-fpm
ERROR: Conf php7.4-fpm does not exist!
root@DietPi:~#

try to remove PHP and have it installed again

dietpi-software uninstall 89
dietpi-software install 89

Hello,

sorry for the late reply.
Uninstalling php alone did not help, but you pointed me to the right direction :slight_smile:
I uninstalled php, mariadb, phpmyadmin, apache and letsencrypt via dietpi-software and installed them again afterwards.
Now everything seems to work fine.

Thanks and kind regards
Andi

1 Like

yeah, that was the big “solution”. :wink:

Just to follow up, the problem seems to be that /etc/apache2/conf-available/php7.4-fpm.conf no longer exists. I recreated the file and was able to continue. I guess something from the apache uninstall deleted that file?

That is the file which matters for the failing command and is shipped by the php7.4-fpm package:

dpkg -S /etc/apache2/conf-available/php7.4-fpm.conf

But as a “conffile”, if it gets manually removed once, it isn’t reinstalled automatically on a package upgrade or reinstall, but only when purging the package once or forcing it with an apt/dpkg flag. If this was the issue, the following file should exist:

ls -l /etc/apache2/conf-available/php7.4-fpm.conf.dpkg-dist

Ah and if Apache is unistalled, the whole /etc/apache2 is removed indeed, which causes this issue. Probably we should check via dpkg -S whether another package ships a contained file before removing each.

That all sounds about right.

The whole issue came about when I noticed webgui’s that were supposed to be on port 80 were no longer working and any HTTP requests caused the 404 page not found error. All other ports were functioning fine. I went through a bunch of apache config troubleshooting, disabling Apache, and finally uninstalling Apache but HTTP still got the 404 error. lsof didn’t show any process listening on port 80, but somehow something was at least doing something to cause the 404 error. Turned out it was k8s somehow taking over port 80 and 443 (https) but not showing up in lsof. Everything returned to “normal” when I uninstalled k8s.