Comment 2 for bug 1889988

Hi Ricardo:

From your log:
info: Executing deferred 'a2enmod php7.2' for package libapache2-mod-php7.2
ERROR: Module php7.2 does not exist!

But that package isn't available in Ubuntu 20.04 anymore.
It's successor would be libapache2-mod-php7.4 and that would work.
It also would remove the older version as it has:
Conflicts: libapache2-mod-php7.2, libapache2-mod-php7.3

I was creating a new bionic guest and installing libapache2-mod-php7.2 to check how it would behave on an upgrade.

After the install I got:
# start with bionic
$ apt install libapache2-mod-php7.2
# update /etc/apt/sources.list to focal
$ apt dist-upgrade

This will leave the system with the old PHP working as it did before, but not failing as you've shown.

What is the install status of your libapache2-mod-php7.2 is it gone or still installed.
In general you should upgrade (when your code needing it is ok for php7.4) to the new libapache2-mod-7.4.

I can't find the root cause for your bug TBH, checking libapache2-mod-php7.2 seems to be a good first step.

P.S. I was wondering about the upgrade not switching to php7.4 on it's own so I tried the "real" release to release upgrade path as such things could be covered by do-release-upgrade. That did remove 7.2, but not install 7.4 - I have a friend who worked on that and I'll file a new bug for it as that seems not directly tied to your problem.