Apache 2.4 cannot proceed due to conflicts with Module mpm_prefork
Solution 1
I would use the proper command to disable a mod in Apache:
sudo a2dismod mpm_prefork
Solution 2
You should try to remove the symlinks /etc/apache2/mods-enabled/mpm_prefork.{conf,load}
:
rm /etc/apache2/mods-enabled/mpm_prefork.{conf,load}
Then relaunch the configuration of the apache2
package:
apt-get install -f
Or:
apt-get install apache2
But more important, you should ask yourself how these were installed there before hand. You might have copied an older /etc/apache2
directory with these (for instance) before launching apt-get install apache2
.
Solution 3
There are apparently 3 different versions of this module (mpm_worker
vs mpm_prefork
vs mpm_event
), and the error code can be misleading. Try disabling all three variants and then reinstalling. In my case (Mint 19.1/Ubuntu 18.04, php7.2), was the third:
root@machine:/var/www/html# sudo a2dismod mpm_worker
Module mpm_worker already disabled
root@machine:/var/www/html# sudo a2dismod mpm_prework
ERROR: Module mpm_prework does not exist!
root@machine:/var/www/html# sudo a2dismod mpm_event
Module mpm_event disabled.
After this, installing the apache php mod worked (sudo a2enmod php7.2
) and the code was executed correctly.
Related videos on Youtube
DanielAttard
I am a tax lawyer by training, but I am more interested in learning how to code.
Updated on September 18, 2022Comments
-
DanielAttard over 1 year
I have just updated from 12.04 to 14.04 and now have difficulty setting up Apache 2.4 I am getting the following error:
Setting up apache2 (2.4.10-1+deb.sury.org~trusty+1) ... ERROR: Module mpm_prefork is enabled - cannot proceed due to conflicts. It needs to be disabled first! dpkg: error processing package apache2 (--configure): subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing: apache2 E: Sub-process /usr/bin/dpkg returned an error code (1)
How can I disable the mpm_prefork so that Apache can continue?
-
CoderGuy123 over 4 yearsI just get
Module mpm_prefork already disabled
. My situation is that php7.2 didn't install itself into apache2.4 correctly, and I can't fix it because this command doesn't work.