We must stay with current stable release of any language specially if it is PHP.
Lets learn how to upgrade from php 7.2 to php 7.4
Install PHP 7.4
sudo apt install php7.4
Lets install some commonly used php extensions
sudo apt install php7.4-common php7.4-mysql php7.4 php7.4-cgi libapache2-mod-php7.4 php-pear php7.4-mbstring
We have completed our installation of php 7.4
Lets disable php 7.2 for apache and enable php 7.4 for Apache
sudo a2dismod php7.2
sudo a2enmod php7.4
Finally we need to restart Apache to use new version of php
sudo service apache2 restart