how to resolve Apache apachectl[5465]: Segmentation fault (core dumped)?

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: 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

2 Answers

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.

1

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.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like