I had this problem too. I upgraded from Ubuntu 17.04 to Ubuntu 17.10 and then php did not work and there was no php.conf file in /etc/apache2/mods-enabled
.
When I tried sudo a2enmod php7.1
I was given the same error:
Considering dependency mpm_prefork for php7.0:
Considering conflict mpm_event for mpm_prefork:
ERROR: Module mpm_event is enabled - cannot proceed due to conflicts. It needs to be disabled first!
Considering conflict mpm_worker for mpm_prefork:
ERROR: Could not enable dependency mpm_prefork for php7.0, aborting
I used sudo a2dismod mpm_event
and received no errors. I restarted apache2 and then used sudo a2enmod php7.1
and it worked just fine. Restarted apache2 again and now php is working again and I can see phpinfo()
in my browser when I couldn't before.
sudo apt-get install libapache2-mod-php7.0
, thensudo a2enmod php7.0
, then restart apache withsudo apache2ctl restart
.sudo a2dismod mpm_event
to disable that conflicting module, then try runningsudo a2enmod php7.0
again.sudo a2enmod mpm_prefork
. That should allow the apache service to start up.