How to Install PHP Versions in EasyApache 4

PHP 7.2 reaches end of life (EOL) in January 2021 and PHP 8 will be released soon. With these major changes affecting PHP-based content management systems (CMSs) and overall LAMP-stack server security, it’s important to know how to maintain up-to-date PHP versions on your cPanel-managed VPS or dedicated server with WebHost Manager (WHM).

Below we cover how to:

Secure your cPanel accounts with our Managed VPS Hosting.

Update Your cPanel Server

Before continuing to install new PHP versions:

  1. Ensure cPanel is up to date. You can update cPanel via SSH or log into WHM as root to check for an update notification in the upper-right corner.
  2. Ensure EasyApache4 is installed by searching for it on the left side of WHM. If not, or you have EasyApache3 instead, install EasyApache4.
  3. Create a server snapshot in your Account Management Panel (AMP).

Install PHP Versions in EasyApache4

PHP Versions toggle buttons highlighted
Click to enlarge this screenshot image.
  1. Log into WHM as root.
  2. On the left, search for and select EasyApache4.
  3. At the top, select Customize to edit your current server configuration.
  4. On the left, select PHP Versions.
  5. Uninstalled PHP versions will have a gray slider on the right side. Installed PHP versions will have a blue slider. To install a new PHP version, select the slider for the new PHP version(s) you want to install so it turns blue.

    You should uninstall old PHP versions that have reached end-of-life (PHP 7.2 and older as of August 2020). However, before doing so, you must ensure the older PHP versions aren’t currently used by any web applications on your server before removing them. If you’re unsure about this, install the newest PHP version first. Then audit your server environment before removing an older PHP version.

  6. Select Next to make further changes within EA4 until you reach the Review section. If you don’t need to make any other changes besides install PHP versions, simply select Review on the left.
  7. Review the pending changes. Once you’re sure of the changes you want to make, select Provision at the bottom.
  8. Select Done.

Looking for ways to ensure your cPanel VPS or dedicated server is secure? Check out our guide on how to harden managed VPS Hosting.

Was this article helpful? Let us know!