Cannot enable php7.4 on Ubuntu 20.04

I'm trying to set up nextcloud on a home ubuntu box.

I've got php 7.4 installed, apache, etc.

However apache2ctl -M does not show php as shared. This causes (I guess) the http://localhost/nextcloud setup GUI to render as raw php code in the browser.

When I try to do a2enmod php7.4 I get:

Considering dependency mpm_prefork for php7.4:
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.4, aborting

When i attempt to a2dismod mpm_worker or mpm_prefork it says

Module mpm_prefork already disabled

This is a new install, no previous versions of PHP, etc. I've gone pretty slowly and methodically through the nextcloud docs which seemed to work until I ran into this. I'm also pretty new so if there's any config files I need to edit please let me know their paths.


Solution 1:

Wipe your server (if possible) and use the provided vm scripts from Nextcloud at this link. I was also able to get my own instance going by using php 8.0 instead of 7.4. Docker and snap packages are also available that I can get going.

Solution 2:

The error message is:

Module mpm_event is enabled

you are trying to disable the wrong module.

a2dismod mpm_event