Upgrade PHP 8.0 to PHP 8.1

Add PPA for PHP 8.1

sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
Install PHP 8.1

 

sudo apt install php8.1
Install PHP 8.1 Packages

sudo apt install php8.1-common php8.1-mysql php8.1-xml php8.1-xmlrpc php8.1-curl php8.1-gd php8.1-imagick php8.1-cli php8.1-dev php8.1-imap php8.1-mbstring php8.1-opcache php8.1-soap php8.1-zip php8.1-intl -y
PHP 8 Enable

sudo a2dismod php8.0
sudo a2enmod php8.1

sudo service apache2 restart

  • php, upgrade
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Upgrade PHP 7.4 to PHP 8.0 on Ubuntu 20.04 with Nginx

IntroductionPHP 8.0 is a significant update of the PHP language that contains many new features...