Nextcloud php upgrade from 7.2 to 7.4 on ubuntu 18

so I have nextcloud running on top of ubuntu 18.04.5

and it notified me that I have old php7.2 that should be soon upgraded.

I went to update it, but the newer version was not available on the default repositories, so I needed to find it from somewhere else. That was easy (Thanks Ondřej!) and after checking out the reliability and credibility of the new ppa I added it.

sudo add-apt-repository ppa:ondrej/php

Then to install new php

sudo apt-get update
sudo apt -y install php7.4

and needed packages (I got them from my previous upgrade)

sudo apt-get install php7.4-fpm php7.4-curl php7.4-gd php7.4-mysql php7.4-imagick php7.4-tidy php7.4-xmlrpc php7.4-mbstring php7.4-intl php7.4-xml php7.4-zip php7.4-apcu php7.4-bcmath php7.4-gmp

Installation gave following messages:

NOTICE: Not enabling PHP 7.4 FPM by default.
NOTICE: To enable PHP 7.4 FPM in Apache2 do:
NOTICE: a2enmod proxy_fcgi setenvif
NOTICE: a2enconf php7.4-fpm

To activate the new configuration, you need to run:
systemctl reload apache2

after they were done the system (php -v) was showing that it was using the new php version, but Nextcloud was not (based on Nextcloud admin Overview panel).

Then I decided to disable the old php

sudo a2dismod php7.2
systemctl restart apache2

but that caused Nextcloud to show

Internal Server Error

The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.

Quick fix to that was enable old php back

sudo a2enmod php7.2
systemctl restart apache2

After some checking the solution was to add one new php package.

sudo apt install php7.4-apcu
systemctl restart apache2

and then it worked. Nextcloud admin overview panel didn’t show php complain anymore.