Install PHP 8.2 or 8.1 Debian 11 – Sury PPA

Last updated on April 17th, 2023 at 08:14 pm.

Install PHP 8.1 Debian 11

Add the DEB.SURY.ORG repository PPA on Debian 11

curl -sSL https://packages.sury.org/php/README.txt | sudo bash -x  ;  sudo apt update

Installing PHP 8.1 FPM and other relevant modules.

Copy the following line and run it in your terminal. This line installs PHP and all the other listed php modules. If you do not need to install any module, just delete it before running this command.

sudo apt install php8.1-fpm php8.1-common php8.1-mysql php8.1-gmp php8.1-curl php8.1-intl php8.1-mbstring php8.1-xmlrpc php8.1-gd php8.1-xml php8.1-cli php8.1-zip php8.1-soap php8.1-imap

Install PHP 8.2 FPM and other relevant modules.

If you need the latest PHP, you can install PHP 8.2 instead of 8.1 as follows. PHP 8.2 will be installed along with the other listed PHP modules.

sudo apt install php8.2-fpm php8.2-common php8.2-mysql php8.2-gmp php8.2-curl php8.2-intl php8.2-mbstring php8.2-xmlrpc php8.2-gd php8.2-xml php8.2-cli php8.2-zip php8.2-soap php8.2-imap

Confirm new PHP version

    php -v 

You can also check the list of installed modules

    php --modules

Related : Ubuntu 22.04 HestiaCP Tutorial – Run WordPress on a VPS

If you experience any problems during this installation process, ask your question in the comments section below.

Comment Here

Need WordPress help? Linux Server help? Talk to us.

  • We are your own WordPress customer service.
  • We set up Linux servers and install or migrate WordPress. Learn more here.
  • We support WooCommerce too.
  • Check out our WordPress customer support plans here or contact us below .

If you have any questions regarding WordPress support, Linux server support or any of our services, feel free to reach out or read more on our services page.

Join this free course:

How to host multiple WordPress
websites on a VPS

Close me!