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 Answers3

8

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

sudo a2dismod mpm_prefork
Renato
  • 81
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.

vaab
  • 1,112
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.