The fix for 1850933 is only handling 7.2->7.4 and 7.3->7.4 upgrades. Presumably a similar fix could be done for other upgrade paths to 7.4, but an SRU would probably be needed for 7.0->7.2 upgrades.
However, the more pressing issue would be why the 7.2->7.4 upgrade done in comment #2 did not work as intended by the fix.
I'm reproducing a failure using clean lxc:
Preparing to unpack .../25-apache2-bin_2.4.41-4ubuntu2_amd64.deb ...
Unpacking apache2-bin (2.4.41-4ubuntu2) over (2.4.29-1ubuntu4.13) ...
Preparing to unpack .../26-libapache2-mod-php_2%3a7.4+75_all.deb ...
Unpacking libapache2-mod-php (2:7.4+75) over (1:7.2+60ubuntu1) ...
(Reading database ... 32550 files and directories currently installed.)
Removing libapache2-mod-php7.2 (7.2.24-0ubuntu0.18.04.3) ...
Package apache2 is not configured yet. Will defer actions by package libapache2-mod-php7.2.
Selecting previously unselected package libapache2-mod-php7.4.
(Reading database ... 32543 files and directories currently installed.)
Preparing to unpack .../libapache2-mod-php7.4_7.4.3-4ubuntu1_amd64.deb ...
Unpacking libapache2-mod-php7.4 (7.4.3-4ubuntu1) ...
...
Setting up libapache2-mod-php7.4 (7.4.3-4ubuntu1) ...
Package apache2 is not configured yet. Will defer actions by package libapache2-mod-php7.4.
Creating config file /etc/php/7.4/apache2/php.ini with new version
libapache2-mod-php7.4: php7.2 module already enabled, not enabling PHP 7.4
Setting up packagekit-tools (1.1.13-2ubuntu1) ...
Setting up apache2 (2.4.41-4ubuntu2) ...
Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xe" for details.
invoke-rc.d: initscript apache2, action "restart" failed.
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2020-04-14 18:16:42 UTC; 4ms ago
Docs: https://httpd.apache.org/docs/2.4/
Process: 56492 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
Apr 14 18:16:42 php-fix-lp1865218-mod-php-upgrade systemd[1]: Starting The Apache HTTP Server...
Apr 14 18:16:42 php-fix-lp1865218-mod-php-upgrade apachectl[56496]: apache2: Syntax error on line 146 of /etc/apache2
/apache2.conf: Syntax error on line 3 of /etc/apache2/mods-enabled/php7.2.load: Cannot load /usr/lib/apache2/modules/
libphp7.2.so into server: /usr/lib/apache2/modules/libphp7.2.so: cannot open shared object file: No such file or dire
ctory
Apr 14 18:16:42 php-fix-lp1865218-mod-php-upgrade apachectl[56492]: Action 'start' failed.
Apr 14 18:16:42 php-fix-lp1865218-mod-php-upgrade apachectl[56492]: The Apache error log may have more information.
Apr 14 18:16:42 php-fix-lp1865218-mod-php-upgrade systemd[1]: apache2.service: Control process exited, code=exited, s
tatus=1/FAILURE
Apr 14 18:16:42 php-fix-lp1865218-mod-php-upgrade systemd[1]: apache2.service: Failed with result 'exit-code'.
Apr 14 18:16:42 php-fix-lp1865218-mod-php-upgrade systemd[1]: Failed to start The Apache HTTP Server.
invoke-rc.d: release upgrade in progress, error is not fatal
Setting up fwupd-signed (1.27+1.3.9-4) ...
Setting up software-properties-common (0.98.7) ...
Setting up libapache2-mod-php (2:7.4+75) ...
...
Setting up ubuntu-server (1.447) ...
Processing triggers for php7.4-cli (7.4.3-4ubuntu1) ...
Processing triggers for dbus (1.12.16-2ubuntu2) ...
Processing triggers for libapache2-mod-php7.4 (7.4.3-4ubuntu1) ...
...
Purging configuration files for php7.2-common (7.2.24-0ubuntu0.18.04.3) ...
dpkg: warning: while removing php7.2-common, directory '/etc/php/7.2/mods-available' not empty so not removed
Purging configuration files for php7.2-opcache (7.2.24-0ubuntu0.18.04.3) ...
Purging configuration files for php7.2-cli (7.2.24-0ubuntu0.18.04.3) ...
dpkg: warning: while removing php7.2-cli, directory '/etc/php/7.2/cli/conf.d' not empty so not removed
# ls /etc/apache2/mods-enabled/php*
/etc/apache2/mods-enabled/php7.2.conf /etc/apache2/mods-enabled/php7.2.load
The fix for 1850933 is only handling 7.2->7.4 and 7.3->7.4 upgrades. Presumably a similar fix could be done for other upgrade paths to 7.4, but an SRU would probably be needed for 7.0->7.2 upgrades.
However, the more pressing issue would be why the 7.2->7.4 upgrade done in comment #2 did not work as intended by the fix.
I'm reproducing a failure using clean lxc:
Preparing to unpack .../25- apache2- bin_2.4. 41-4ubuntu2_ amd64.deb ... 1ubuntu4. 13) ... libapache2- mod-php_ 2%3a7.4+ 75_all. deb ... mod-php7. 2 (7.2.24- 0ubuntu0. 18.04.3) ... mod-php7. 2. mod-php7. 4. mod-php7. 4_7.4.3- 4ubuntu1_ amd64.deb ... mod-php7. 4 (7.4.3-4ubuntu1) ...
Unpacking apache2-bin (2.4.41-4ubuntu2) over (2.4.29-
Preparing to unpack .../26-
Unpacking libapache2-mod-php (2:7.4+75) over (1:7.2+60ubuntu1) ...
(Reading database ... 32550 files and directories currently installed.)
Removing libapache2-
Package apache2 is not configured yet. Will defer actions by package libapache2-
Selecting previously unselected package libapache2-
(Reading database ... 32543 files and directories currently installed.)
Preparing to unpack .../libapache2-
Unpacking libapache2-
... mod-php7. 4 (7.4.3-4ubuntu1) ... mod-php7. 4.
Setting up libapache2-
Package apache2 is not configured yet. Will defer actions by package libapache2-
Creating config file /etc/php/ 7.4/apache2/ php.ini with new version mod-php7. 4: php7.2 module already enabled, not enabling PHP 7.4 system/ apache2. service; enabled; vendor preset: enabled) /httpd. apache. org/docs/ 2.4/ /usr/sbin/ apachectl start (code=exited, status=1/FAILURE)
libapache2-
Setting up packagekit-tools (1.1.13-2ubuntu1) ...
Setting up apache2 (2.4.41-4ubuntu2) ...
Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xe" for details.
invoke-rc.d: initscript apache2, action "restart" failed.
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/
Active: failed (Result: exit-code) since Tue 2020-04-14 18:16:42 UTC; 4ms ago
Docs: https:/
Process: 56492 ExecStart=
Apr 14 18:16:42 php-fix- lp1865218- mod-php- upgrade systemd[1]: Starting The Apache HTTP Server... lp1865218- mod-php- upgrade apachectl[56496]: apache2: Syntax error on line 146 of /etc/apache2 mods-enabled/ php7.2. load: Cannot load /usr/lib/ apache2/ modules/ apache2/ modules/ libphp7. 2.so: cannot open shared object file: No such file or dire lp1865218- mod-php- upgrade apachectl[56492]: Action 'start' failed. lp1865218- mod-php- upgrade apachectl[56492]: The Apache error log may have more information. lp1865218- mod-php- upgrade systemd[1]: apache2.service: Control process exited, code=exited, s lp1865218- mod-php- upgrade systemd[1]: apache2.service: Failed with result 'exit-code'. lp1865218- mod-php- upgrade systemd[1]: Failed to start The Apache HTTP Server. properties- common (0.98.7) ... mod-php7. 4 (7.4.3-4ubuntu1) ...
Apr 14 18:16:42 php-fix-
/apache2.conf: Syntax error on line 3 of /etc/apache2/
libphp7.2.so into server: /usr/lib/
ctory
Apr 14 18:16:42 php-fix-
Apr 14 18:16:42 php-fix-
Apr 14 18:16:42 php-fix-
tatus=1/FAILURE
Apr 14 18:16:42 php-fix-
Apr 14 18:16:42 php-fix-
invoke-rc.d: release upgrade in progress, error is not fatal
Setting up fwupd-signed (1.27+1.3.9-4) ...
Setting up software-
Setting up libapache2-mod-php (2:7.4+75) ...
...
Setting up ubuntu-server (1.447) ...
Processing triggers for php7.4-cli (7.4.3-4ubuntu1) ...
Processing triggers for dbus (1.12.16-2ubuntu2) ...
Processing triggers for libapache2-
...
Purging configuration files for php7.2-common (7.2.24- 0ubuntu0. 18.04.3) ... 7.2/mods- available' not empty so not removed 0ubuntu0. 18.04.3) ... 0ubuntu0. 18.04.3) ... 7.2/cli/ conf.d' not empty so not removed
dpkg: warning: while removing php7.2-common, directory '/etc/php/
Purging configuration files for php7.2-opcache (7.2.24-
Purging configuration files for php7.2-cli (7.2.24-
dpkg: warning: while removing php7.2-cli, directory '/etc/php/
# ls /etc/apache2/ mods-enabled/ php* mods-enabled/ php7.2. conf /etc/apache2/ mods-enabled/ php7.2. load
/etc/apache2/