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:
- 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.
- Ensure EasyApache4 is installed by searching for it on the left side of WHM. If not, or you have EasyApache3 instead, install EasyApache4.
- Create a server snapshot in your Account Management Panel (AMP).
Install PHP Versions in EasyApache4
- Log into WHM as root.
- On the left, search for and select EasyApache4.
- At the top, select Customize to edit your current server configuration.
- On the left, select PHP Versions.
- 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.
- 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.
- Review the pending changes. Once you’re sure of the changes you want to make, select Provision at the bottom.
- 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.