How to add PHP 8.1 to CloudPanel?

How to add PHP 8.1 to CloudPanel?

PHP 8.1 is a major update of the PHP language. It contains many new feature like:

In this tutorial, I will explain how to add PHP 8.1 to your existing CloudPanel installation. The newest CloudPanel version is being shipped with PHP 8.1.

Installation

Before you start with the installation, make sure to make a backup of the server in case of an unexpected error.

  1. First, we need to add the PHP 8.1 package sources:
nano /etc/apt/sources.list.d/packages.cloudpanel.io.list

Add the following lines after the PHP 8.0:

deb https://d17k9fuiwb52nc.cloudfront.net/ buster php-8.1
deb-src https://d17k9fuiwb52nc.cloudfront.net/ buster php-8.1
  1. Update the package sources:
apt update
  1. Install PHP 8.1 packages:
apt-get install -y php8.1-common php8.1-fpm php8.1 php8.1-zip php8.1-soap php8.1-opcache php8.1-mysql php8.1-cli php8.1-gd php8.1-curl php8.1-xsl php8.1-imap php8.1-intl php8.1-sqlite3 php8.1-bcmath php8.1-mbstring php8.1-readline

Done

That's it, you can now use PHP 8.1 in your CloudPanel.

Stefan Wieczorek
Stefan Wieczorek
Founder & CTO

He has over 20 years of experience as a PHP Developer and Linux System Administration. He likes to develop solutions to make complicated things easy to use.

You can find him in the CloudPanel Discord Channel.


Deploy CloudPanel For Free! Get Started For Free!