Cloud Service >> Knowledgebase >> WHM >> How to Install Multiple PHP Versions and PHP Extensions on a cPanel/WHM Server?
submit query

Cut Hosting Costs! Submit Query Today!

How to Install Multiple PHP Versions and PHP Extensions on a cPanel/WHM Server?

When working with a cPane­l/WHM server, handling multiple PHP ve­rsions is a must. It keeps various web apps compatible­. Let me guide you on how to se­t up and handle different PHP ve­rsions and extensions, step by ste­p.

Prerequisites

- Root Access: You want root or sudo get right of entry to to the server.

- cPanel/WHM: A server strolling cPanel/WHM.

- Internet Connection: To download PHP versions and extensions.

Step 1: Access WHM

1. Log in to your WHM interface using the foundation account.

2. Once logged in, look for EasyApache 4 in the search bar.

Step 2: Install PHP Versions Using EasyApache four

1. Click on EasyApache 4 beneath the Software section.

2. In the EasyApache four interface, you’ll see the choice to customise your profile.

3. Click on Customize subsequent to the presently installed profile.

4. Navigate to the PHP Versions segment.

5. You’ll see a listing of to be had PHP versions. Select the PHP versions you need to put in with the aid of checking the corresponding packing containers.

6. Click Next to continue through the options, retaining the default settings except you need specific configurations.

7. Finally, click on Provision to install the chosen PHP versions. This procedure might take a couple of minutes.

Step 3: Set the Default PHP Version

1. After provisioning, go to MultiPHP Manager in WHM.

2. In the MultiPHP Manager interface, you can set the default PHP model for the server.

3. You can also assign distinct PHP versions to individual domain names by deciding on the area and choosing the desired PHP version from the dropdown menu.

Step 4: Install PHP Extensions

1. Return to EasyApache 4.

2. In the Currently Installed Packages phase, click on on Customize.

3. Navigate to the PHP Extensions phase.

4. Here, you’ll see a list of available extensions for each PHP model mounted. Check the extensions you want to install.

5. Click Next to proceed, and then click Provision to install the selected extensions.

Step 5: Verify Installation

1. To confirm the set up of PHP versions, pass returned to MultiPHP Manager.

2. To affirm established extensions, you can use the command line or create a PHP report with phpinfo(); to test the loaded extensions.

Step 6: Manage and Update PHP Versions and Extensions

1. You can control and update PHP variations and extensions from the EasyApache 4 interface at any time.

2. For protection, make sure that old PHP versions are uninstalled or confined from public get admission to.

Tips:

- Compatibility: Ensure that your packages are compatible with the PHP variations you plan to put in.

- Security: Regularly update PHP variations and extensions to their today's strong variations.

- Testing: Before switching the PHP version for a stay web page, test it on a staging environment to keep away from breaking the site.

Troubleshooting:

- Missing PHP Versions/Extensions: If a PHP model or extension isn't always indexed, ensure that your server’s repositories are updated.

- Errors After Switching PHP Versions: Review the mistake logs (placed in the cPanel interface or via command line) to troubleshoot any issues.

By following those steps, you may successfully control a couple of PHP variations and extensions in your cPanel/WHM server, making sure that your server can guide diverse internet packages with one of a kind necessities.

Cut Hosting Costs! Submit Query Today!

Grow With Us

Let’s talk about the future, and make it happen!