How to Install PHP Versions in EasyApache 4

PHP 7.2 reached end of life (EOL) in January 2021 and PHP 8 is available now. The major changes of this new PHP version affect many of the most popular PHP-based content management systems (CMSs) and overall LAMP-stack server security as features have been heavily revised for better security and performance. it’s important to know how to maintain up-to-date PHP versions on your cPanel VPS or dedicated server with WebHost Manager (WHM).

Below we cover how to:

Get better performance and security with our Managed VPS Hosting.

Ensure cPanel is Updated

Before continuing to install 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 with EasyApache4

Install PHP Versions with toggle buttons
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.3 and older as of January 2021). 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 test all websites and applications in your server environment to ensure there are no compatibility issues. Afterwards, remove the older PHP version(s).

  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. Or learn more about managing cPanel accounts in our Managed VPS Hosting Product Guide.

J
Jacqueem Technical Writer

Technical writer focused on cybersecurity and musicianship.

More Articles by Jacqueem

Was this article helpful? Let us know!