[Solved] After upgrade to Mint 21, apache will not start

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Avatar1
Level 2
Level 2
Posts: 66
Joined: Mon Jun 19, 2017 7:55 pm

[Solved] After upgrade to Mint 21, apache will not start

Post by Avatar1 »

I already solved this, with help from the IRC peeps, but I wanted to post the problem and solution here in case it helps anyone else.

Problem: apache will not start. Error is the cryptic "Failed to start the Apache HTTP Server."
When doing

Code: Select all

sudo journalctl -xe
, no help there: "apache2.service: failed with result 'exit-code'"
You get more information by going to /etc/apache2 directory and type

Code: Select all

apache2ctl configtest
I saw this error:
apache2: Syntax error on line 149 of /etc/apache2/apache2.conf: Syntax error on line 3 of /etc/apache2/mods-enabled/php7.4.load: Cannot load /usr/lib/apache2/modules/libphp7.4.so into server: /usr/lib/apache2/modules/libphp7.4.so: cannot open shared object file: No such file or directory
Action 'configtest' failed.
The Apache error log may have more information.
Wait, why is it trying to load php7.4? I saw during the upgrade that it was uninstalling php7.4 and installing php8.1 in its place.
Checking /etc/apache2/mods-enabled does show the php7.4 modules and not php8.1.
Sure enough,

Code: Select all

dpkg -l | grep php
shows php7.4 still installed, and

Code: Select all

sudo a2enmod php7.4
states "Module php7.4 already enabled"
So I think the mintinstaller messed up a little bit here.

So the fix ended up being

Code: Select all

sudo a2dismod php7.4
sudo a2enmod php8.1
systemctl restart apache2
Apache now starts! Thanks to this link for the hints: https://stackoverflow.com/questions/720 ... -ubuntu-22

Still can't get phpmyadmin working, but one thing at a time :D
Last edited by LockBot on Thu Feb 09, 2023 11:00 pm, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
arimakidd
Level 3
Level 3
Posts: 101
Joined: Thu Nov 02, 2017 11:37 pm

Re: [Solved] After upgrade to Mint 21, apache will not start

Post by arimakidd »

This post is a real life saver. Thank you and thak you. :D
Locked

Return to “Installation & Boot”