Home » Install PHP8.2 on WHM/Cpanel Server

Install PHP8.2 on WHM/Cpanel Server

How to install php 8.2 on WHM/Cpanel Server

PHP 8.2 was released in November 2022. It includes several new features including readonly classes, null, false, and true as stand-alone types, deprecated dynamic properties, performance improvements and more.

The newer PHP versions including PHP 8.0, 8.1 and 8.2 offer significant performance improvements compared to the older versions. PHP 7.4 entered its End of Life in November 2022. It means that active support and security support for PHP 7.4 will no longer be available. A large number of websites worldwide are still using PHP 7.4 which creates both security and performance related risks. It is important for WordPress users to keep their versions of WordPress and PHP as well as plugins and themes updated. This is important from both security and performance point of view.

Hosts are offering the option to upgrade to PHP 8 and PHP 8.1 mainly. Some might even remove PHP 7.4 after some time and it is best for you to switch to PHP 8 or above. Many hosts offer one click PHP update like Kinsta. However, if you want to manually update your PHP version, you can easily do that from your Cpanel -. MultiPhp Manager.

While most hosts are offering PHP 8 and PHP 8.1, I am not sure PHP8.2 might still be available in your Cpanel if you want to upgrade. While PHP 8 and 8.1 are also great options, it is usually good to switch to the latest version or at least try the latest version to know about any incompatibilities including plugin and other incompatibilities. So, you can check if PHP 8.2 is available in your Cpanel yet.

Installing PHP 8.2 will not require you to download any software or run any code if you do it from WHM using EasyApache 4.

EasyApache 4 makes it easier for users to install modules, change MPM, install new PHP versions, PHP extensions and other packages. It is available only on Apache 2.4. So, if you are running older versions of WHM or Cpanel, you might not have access to EasyApache4 and its exciting features.

If you need to install a PHP module, you have two options before you. You can either connect to a yum repository or use the EasyApache4 interface which only includes the modules Cpanel provides.

EasyApache 4 provides the following benefits:

  • Updates to PHP, Apache, and the modules you select.
  • Multiple concurrent versions of PHP like PHP 8, PHP 8.1 and PHP 8.2.
  • Decreased security vulnerabilities due to automatic updates. Your EasyApache4 interface will let you know when there is an update available.
  • A simplified method to add, remove, or install components of your web server. Compared to connecting to yum repositories, it is a much simplified method for installing modules and other updates, changing configurations and making updates.
  • EasyApache 4 also offers recommendations about compatibility. For example, if you are trying to install a PHP version, it will also offer to install the necessary PHP extensions simultaneously. If you are trying to install NGIN Reverse Proxy Package, it will also suggest the required modules and the incompatible modules that will need to be uninstalled. So, if a particular module or extension is not compatible with your current server set up, it will let you know. It means no worrying over incompatibilities.
  • Easy access to information about the options you select. You will also find information related to the modules or extensions and packages you install using EasyApache4, right there in the interface.

According to the Cpanel website,

“EasyApache 4 (EA4) installs, configures, updates, and validates your web server, PHP, and the other components of your web server. EasyApache 4 represents a total overhaul of how cPanel & WHM ships and maintains our Apache and PHP distributions.”

Cpanel EasyApache4

If you do not have EasyApache4 installed on your WHM server, you can ask your host to install it. EasyApache4 supports PHP versions 5.4 through 5.6, PHP versions 7.0 through 7.4, and PHP 8.0 through 8.2. However, if you try to install an older version that has entered EOL (End of Life), you will be able to install it, but you will also receive a warning. Another important benefit of EasyApache 4 is that you can install several PHP versions on your server. If you want to install PHP 8.0, 8.1 and 8.2, you can install all three and the relevant PHP extensions. So, you can test and switch from one to another if you like. All the three PHP versions will remain available in your Cpanel, MultiPHP manager.

How to install PHP 8.2 using EasyApache 4

Login to WHM as a root user and search for EasyApache 4.

You will find it in the Software section.

Click on EasyApache 4 to enter the easyApache4 interface.

You will see that there are several profiles here. The current profile that is in use must be listed at the top.

The cPanel default profile includes PHP versions 8.0, 8.1, and 8.2. However, if you cannot see PHP 8.2 in the MultiPHP manager yet, it means it has not been installed even if it is available in the package.

You only need to customize your current profile and add PHP8.2 and the necessary extensions. The latest PHP versions that are available in the currently installed profile will be listed there. So, if PHP8.2 is not available in your current profile, you can find it without opening the profile.

If you have more than one websites hosted on the same server, you can run a different version on each one if you like or set a default version if you prefer and set the websites to inherit the version. Suppose you like the functionality of PHP8.1 better than the other two versions – PHP 8.0 and PHP 8.2, you can make 8.1 your default PHP version and set each website hosted on your server to inherit PHP 8.1. We will discuss it in detail later to how to do it.

To install PHP 8.2, you need to customize the current package installed on your server in the EasyApache 4 interface. You can also check the available modules, PHP versions, and PHP extensions which are included in the current package by clicking on ‘View All Packages’. This will allow you to check if everything that you want to install on your server is included in the current package. Suppose you want to install both PHP8.2 and Opcode cache. However, if Opcode cache is not included in the current package, you can select and customize another package that has both PHP 8.2 and Zend Opcache included.

Package details are visible under the profile.

 Now, once you have checked the currently installed package for PHP 8.2 and if it is available there click on ‘Customize’.

On the left, you will find the following options when you open the package for customization:

  • Apache MPM
  • Apache Module
  • PHP versions
  • PHP Extensions
  • Ruby Via Passenger
  • Additional Packages
  • Review

Click on PHP versions. Here you will see the list of PHP versions starting PHP 5.4 and till PHP 8.2. You can install PHP 8.0, PHP 8.1 and PHP 8.2 from here. Suppose you have only PHP 8 available in your Cpanel MultiPHP manager, then you can add both PHP 8.1 and PHP 8.2 and their extensions from here.

You only need to toggle the install button next to the relevant version and the EasyApache4 interface will offer you to install the related PHP extensions as well. Select to install both the PHP versions and their extensions.

Once done, click on review on the left. You can review the package before provisioning. It shows you the new modules, PHP versions or extensions you are installing, as well as the modules and extensions that will be affected or remain unaffected by it.

Once you have reviewed the information, click on provision.

You will receive a notice that the provision process has started. The provision process can take a few minutes. When the provision process starts, you will receive the notification that the provision process has started and at the end that the process is complete.

The provision process is complete with the above notification.

Once you have installed PHP versions, you can again go back to EasyApache4 and take a look at the installed PHP versions. It will look like in the image below:

When the process is complete, you will have PHP 8.2 installed on your server. If you selected other versions also, you will now find them in the dropdown list in the MultiPHP manager.

To check, you can go to the Cpanel for any of your websites, hosted on the server and go to MultiPHP manager. In the dropdown list on the right, you will find all the versions you have currently installed on your server. If you want to switch to PHP 8.2, you can change it from here. Suppose you have been using PHP 7.4 and you want to check each version before using, you can select any version like PHP8.1 and set it for one website. Go back to your website and load it. Then check the admin dashboard and posts for any issues. If there are any incompatibilities or issues, you will notice them easily in the beginning or after brief use. You can directly switch to version 8.2 from PHP 7.4 if you like.