https://websiteforstudents.com/upgrading-wordpress-php-7-1-to-php-7-2-to-php-7-3-on-ubuntu-16-04-18-04-with-apache2/
This will help you upgrade to 7.3.
This is what I use to install PHP for WordPress.
sudo apt install php7.3 libapache2-mod-php7.3 php7.3-common php7.3-mysql php7.3-gmp php7.3-curl php7.3-intl php7.3-mbstring php7.3-xmlrpc php7.3-gd php7.3-xml php7.3-cli php7.3-zip
I have been working on better securing my web sites in WP. I installed the Health Check plugin.
It checked the php components and found a few missing. CURL, which I had installed so I refollowed these steps to verify it for php 7.3
First Install CURL by typing sudo apt-get install curl
Then Restart Apache by typing sudo service apache2 restart
Then Install PHP5 CURL by typing sudo apt-get install php7.3-curl
will prompt to install… type y or yes!
Then Restart Apache by typing sudo service apache2 restart
Done! It now shows up in phpMyAdmin.
I have upgraded to the latest LAMP components that you are read about on Ubuntu pages. I am on the latest version of WordPress. This mainly affects my main webpage with videos of my children. These files can be huge.
/etc/php/7.3/fpm/php.ini
/etc/php/7.3/apache2/php.ini
upload_max_filesize = 768M
post_max_size =768M
memory_limit = 768M
max_execution_time = 360
Health Check said these two components were missing. fpm had some errors too.
sudo apt-get install php7.3-bcmath
sudo apt-get install php7.3-imagick
I ran the commands below in various order to fix fpm
sudo a2enmod proxy_fcgi setenvif
sudo a2enconf php7.3-fpm
sudo apt purge libapache2-mod-php7.3 libapache2-mod-php
sudo apt install libapache2-mod-php7.3 libapache2-mod-php
After I fixed these errors, I ran update and dist-upgrade again to get the latest versions.