4

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?

3 Answers 3

7

I would use the proper command to disable a mod in Apache:

sudo a2dismod mpm_prefork
2
  • I 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. Aug 27, 2019 at 23:30
  • Thank, For me other disables was needed before: sudo a2dismod php8.1; sudo a2dismod mpm_prefork; sudo systemctl restart apache2 Jan 2 at 14:47
5

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.

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.