6

I recently ran an apt upgrade and while everything seemed fine, now when I try and get apache2 running I run into the following issues,

$ sudo systemctl start apache2
Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xe" for details.
$ systemctl status apache2
● apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Thu 2022-02-10 13:35:40 PST; 30s ago
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 6919 ExecStart=/usr/sbin/apachectl start (code=exited, status=139)

Feb 10 13:35:39 Mythbox systemd[1]: Starting The Apache HTTP Server...
Feb 10 13:35:40 Mythbox apachectl[6919]: Segmentation fault (core dumped)
Feb 10 13:35:40 Mythbox apachectl[6919]: Action 'start' failed.
Feb 10 13:35:40 Mythbox apachectl[6919]: The Apache error log may have more information.
Feb 10 13:35:40 Mythbox systemd[1]: apache2.service: Control process exited, code=exited, status=139/n/a
Feb 10 13:35:40 Mythbox systemd[1]: apache2.service: Failed with result 'exit-code'.
Feb 10 13:35:40 Mythbox systemd[1]: Failed to start The Apache HTTP Server.
~$ sudo apachectl configtest
Syntax OK

Nothing presents in the error log, and that is with loglevel set to debug, so whatever is happening isn't getting that far. I've tried an apt reinstall apache2 but that didn't make a difference.

At this point I'm stuck in what to do to figure out what is going on. Any ideas?

2
  • 1
    Which error log(s) have you looked at? If there isn’t something in /var/log/apache2/error.log, then there should be something in /var/log/syslog 🤔
    – matigo
    Feb 10, 2022 at 22:35
  • What version of Ubuntu? Server Desktop or Core version?
    – David
    Feb 12, 2022 at 15:44

4 Answers 4

9

On a hunch, I went through and disabled all the apache2 mods, then slowly enabled them, one by one, until I found the one that was causing the crash.

It turned out to be apache2 was trying to load php7.4 and php8.1 which causes the crash. Load just one and it's fine.

2
  • 1
    Well this sucks tho. I got php7.4 and php8.1 enabled at same time when upgrading the ubuntu from 18.04 to 20.04... Ouch... *veteran linux sysadmin hitting wall with this, such shame for myself Mar 27, 2022 at 12:18
  • You may explain it how you did. I am also facing same situation now.
    – Amjith
    Jan 26 at 10:51
0

For some people that upgrading to new Ubuntu 20.04, and face segmentation fault because of using ondrej/php/ubuntu build, welll.. you need to disabled one of the mod_php or fully disable them and use php-fpm. That will fix the problem that raised.

0

I had installed php 7.4 on my Ubuntu 20.0 so apache2 was trying to load php7.4 and php8.1 which was causing the crash. So I uninstalled php version 8.1 from my Ubuntu 20.0 after which apache started working properly.

0

I faced a similar issue with the error message "Apache apachectl[5465]: Segmentation fault (core dumped)" and managed to find a solution that worked for me.

In my case, the problem was related to the php8.2 module. I was able to resolve it by disabling the php8.2 module using the a2dismod command:

sudo a2dismod php8.2

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .