How To Install Multiple PHP versions on cPanel

cPanel is a powerful solution that provides a reliable, automated and intuitive interface and platform for managing websites. It is bundled with a rich feature set and customer-first support and over time it has proven to be the best web hosting platform available in the market.

When hosting websites on cPanel, some clients may require a version of PHP not default in the system. The positive thing is EasyApache 4 allows the use of multiple versions of PHP in cPanel server.

To check the versions of PHP available on the system, navigate to WHM » Home » Software » MultiPHP Manager

From the PHP Version dropdown you can list all PHP versions.

On the Linux OS shell, you can also check the default PHP version:

$ php --version
PHP 8.1.29 (cli) (built: Jun  7 2024 21:33:52) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.29, Copyright (c) Zend Technologies

The desired PHP version can be installed using package manager on the system. Here is a sample list of meta package names:

  • ea-php56
  • ea-php70
  • ea-php71
  • ea-php72
  • ea-php73
  • ea-php74
  • ea-php80
  • ea-php81
  • ea-php82
  • ea-php83
  • Any custom PHP package name.

For example, to install PHP 8.2, use the following command:

sudo dnf install ea-php82

And for PHP 7.4 we will run this command:

sudo dnf install ea-php74

From the dashboard you should be able to see newly added PHP versions.

Inside “User Domain Settings“, you change PHP for a specific domain.

Install a PHP module or extension

The EasyApache 4’s packages for PHP modules and extensions use the ea-php<version>-php-<extension> naming convention, where <version> represents the PHP version number and <extension> represents the name of the PHP module.

See the following example:

sudo dnf install ea-php82-php-gd

CloudSpinx Engineers are available at all times to help you in your IT journey. Don’t hesitate to reach out to us for any support or new project implementation tasks.

Your IT Journey Starts Here!

Ready to level up your IT skills? Our new eLearning platform is coming soon to help you master the latest technologies.

Be the first to know when we launch! Join our waitlist now.

Join our Linux and open source community. Subscribe to our newsletter for tips, tricks, and collaboration opportunities!

Recent Post

Leave a Comment

Your email address will not be published. Required fields are marked *

Related Post

Let’s clarify the differences between merge requests (commonly called pull requests in GitHub), releases, release candidates (RCs), tags, and branches […]

Kind (which in full means “Kubernetes IN Docker”), is a command line tool that enables you to run Kubernetes clusters […]

Are you looking for an easy way to migrate packages from one cPanel server to a new cPanel server? In […]

Let's Connect

Unleash the full potential of your business with CloudSpinx. Our expert solutions specialists are standing by to answer your questions and tailor a plan that perfectly aligns with your unique needs.
You will get a response from our solutions specialist within 12 hours
We understand emergencies can be stressful. For immediate assistance, chat with us now

Contact CloudSpinx today!

Download CloudSpinx Profile

Discover the full spectrum of our expertise and services by downloading our detailed Company Profile. Simply enter your first name, last name, and email address.