First, use the following command to view the php version
php -v
That is to use the 7.2 version of the following command to install gd
sudo apt-get install php7.2-gd
sudo apt-get install php7.2-mysql
Then restart php-frm
NOTE: If you are just another version more php version replaced.