Apache2 error starting

[php7:crit] [pid 7808:tid 140051042680768] Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe. You need to recompile PHP.
start_apache2[7808]: AH00013: Pre-configuration failed
account systemd[1]: apache2.service: Main process exited, code=exited, status=1/FAILURE
account systemd[1]: apache2.service: Failed with result ‘exit-code’.
account systemd[1]: Failed to start The Apache Webserver.

Nice. Any problems with telling us where you saw this and what you did to get it? And is this with after your first trial to start Apache, or after X years of happy running. Maybe after and update. Or ???

Sorry, but we are not clairvoyant.

@tommyrich:

From this Leap 15.4 system with a “vanilla” Apache server:

 # journalctl -b 0 --no-hostname --output=short-monotonic | grep -iE 'Apache|PHP'
[    0.264772] kernel: acpiphp: ACPI Hot Plug PCI Controller Driver version: 0.5
[    7.528767] kernel: audit: type=1400 audit(1686036411.440:10): apparmor="STATUS" operation="profile_load" profile="unconfined" name="php-fpm" pid=892 comm="apparmor_parser"
[   34.477642] systemd[1]: Starting The Apache Webserver...
[   34.599516] systemd[1]: Started The Apache Webserver.
 #

In other words, if the Apache Server isn’t set up for something special, it works …

Consulting Auntie DuckDuckGo revealed the following: <https://bbs.archlinux.org/viewtopic.php?id=178124>.

  • Go to page 4:

the main issue is the you can’t use multithreaded mpm and the single threaded php apache module.
You can switch to prefork and move on.
You can configure php-fpm instead, which isn’t all that difficult but does have the issue that fastcgi has subtly different global variables[$_ENV, $_GET, etc].
Lastly you can make a copy of the php source files, edit PKGBUILD and add '–enable-maintainer-zts ' to the end of the _phpconfig options, then run makepkg and install the thread safe version.


@hcvv:

I’m not usually clairvoyant but, sometimes it helps … :sunglasses:

I hope you got it right and it is of some use to the OP.
In any case, he sems not to be really eager to get this solved. Silent for 6 hours already.

It is working now. I stripped down all the php7 add-ons and apache2 add-on. Started with the basics, which then worked. Then just added what I needed from looking in the conf folder, from my backup.

May I suggest that, you inspect the Apache Web Server documentation –

You may also have to check the “apache2-mod_php7” package for compatibility issues, assuming that, the PHP7 Apache Modules you’re using are those versions required by the Apache Web Server.

1 Like