ondrej\/apache2<\/b> option:<\/p>\n\n\n\nsudo apt install lsb-release ca-certificates apt-transport-https software-properties-common -y\nsudo add-apt-repository ppa:ondrej\/php\n<\/pre>\n\n\n\nWe are going to install the latest version PHP8.0 along with its extensions. Execute the following command and allow some time for the PHP to be installed completely.<\/p>\n\n\n\n
sudo apt install php8.0 -y && sudo apt install php8.0- -y<\/pre>\n\n\n\nCheck if the PHP8.0 installation is successful:<\/p>\n\n\n\n
php -v<\/pre>\n\n\n\nYou should receive the following command:<\/p>\n\n\n\n
root@vps:~# php -v\nPHP 8.0.12 (cli) (built: Oct 22 2021 12:34:48) ( NTS )\nCopyright (c) The PHP Group\nZend Engine v4.0.12, Copyright (c) Zend Technologies\n with Zend OPcache v8.0.12, Copyright (c), by Zend Technologies<\/pre>\n\n\n\nTo check the installed extensions, execute the command below:<\/p>\n\n\n\n
php -m<\/pre>\n\n\n\nYou should see the following output:<\/p>\n\n\n\n
root@vps:~# php -m\n[PHP Modules]\ncalendar\nCore\nctype\ndate\nexif\nFFI\nfileinfo\nfilter\nftp\ngettext\nhash\niconv\njson\nlibxml\nopenssl\npcntl\npcre\nPDO\nPhar\nposix\nreadline\nReflection\nsession\nshmop\nsockets\nsodium\nSPL\nstandard\nsysvmsg\nsysvsem\nsysvshm\ntokenizer\nZend OPcache\nzlib\n\n[Zend Modules]\nZend OPcache<\/pre>\n\n\n\n