How to Change the PHP Version on cPanel

1. Service Direction & Introduction

This guide provides instructions on how to change the PHP version for your hosting account using cPanel. Keeping your PHP version updated is crucial for website security, speed, and compatibility with modern CMS platforms like WordPress, Joomla, and Opencart.

Scope: This article applies to all iCoreHosting Shared Hosting and Reseller Hosting clients with cPanel access.

2. Service Transparency

We utilize the CloudLinux PHP Selector within cPanel. This tool puts you in control of your environment, allowing you to switch between older stable versions and the latest releases without needing server-level intervention.

3. Step-by-Step Guide: How to Change PHP Version

Changing the PHP version in cPanel is a straightforward process. Follow these steps:

Step 1: Log in to cPanel

  • Open your web browser and navigate to your cPanel login page (e.g., yourdomain.com/cpanel).
  • Enter your username and password, then click Log in.

Step 2: Locate the Software Section

  • Once logged in, scroll down to the Software section.
  • Click on the icon labeled Select PHP Version.

Step 3: Select the Desired PHP Version

  • On the PHP Selector | extensions page, look for the dropdown menu labeled "Current PHP Version" at the top.
  • Click the dropdown menu to see the available versions.
  • Select the version you wish to use (e.g., 8.1, 8.2, etc.).

Step 4: Set as Current

  • Crucial Step: After selecting the version in the list, you must click on the text that says Set as current next to the version number.
  • The system will update, and the new version will be applied immediately to your account.

Step 5: Configure PHP Extensions (Optional)

  • You can enable or disable specific PHP extensions (modules) by checking or unchecking the boxes in the list below the version selector.
  • Common extensions include gd, mbstring, and zip.
  • Changes to extensions are usually saved automatically or by clicking a Save button if visible.

Step 6: Verify the Change

  • Open your File Manager in cPanel and navigate to the public_html directory.
  • Create a new file named phpinfo.php.
  • Add the following code to the file:
    <?php phpinfo(); ?>
  • Save the file and visit http://yourdomain.com/phpinfo.php in your browser. The page should display the new PHP version.

4. Common Mistakes

  • Forgetting "Set as Current": Selecting the version in the dropdown does not apply it automatically. You must click "Set as current."
  • Missing Extensions: Sometimes switching PHP versions resets the enabled extensions. If your site breaks after switching, check that required extensions (like mysqli or ioncube_loader) are checked.
  • Caching Issues: If you don't see the change immediately, try clearing your browser cache or your website's cache plugin.

5. Limitations

  • Multi-PHP Manager: This guide applies to the "Select PHP Version" (CloudLinux) tool. If your interface uses "MultiPHP Manager," the steps may vary slightly.
  • Hardcoded Handlers: If you have manually defined a PHP handler in your .htaccess file, it might override the cPanel selector settings.

6. FAQ

Q: I don't see the "Select PHP Version" icon. What should I do?
A: If this icon is missing, the feature might be disabled for your package. Please submit a support ticket to iCoreHosting for assistance.

Q: Will changing the PHP version break my site?
A: It is possible if your website code is outdated and not compatible with newer PHP versions. You can easily revert to the previous version using the same steps if an error occurs.

7. Use Case

Scenario: You are installing the latest version of WordPress, which requires PHP 7.4 or higher. Your current hosting environment is set to PHP 7.2 by default.

Solution: Use this guide to switch your environment to PHP 8.1 or 8.2 to meet the requirements and ensure the installation proceeds smoothly.

8. Summary

Changing your PHP version in cPanel is a quick task that ensures your hosting environment is optimized for your specific application needs. Always remember to check your enabled extensions after switching versions to maintain website functionality.

  • 0 Корисниците го најдоа ова како корисно
Дали Ви помогна овој одговор?

Понудени резултати

How to Obtain cPanel Login Information from Your Current Hosting Provider for Transfer to iCoreHosting

How to Obtain cPanel Login Information from Your Current Hosting Provider for Transfer to...

How to Reset Your Email Login Password via cPanel

If you've forgotten your email login password or need to reset it for security reasons, you can...

How to Log into cPanel Through iCore Hosting Billing Portal

How to Log into cPanel Through the iCore Hosting Billing Portal Table of Contents Service...

How to Connect Outlook Email for the cPanel Control Panel at iCoreHosting

How to Connect Outlook Email for the cPanel Control Panel at iCoreHosting This guide provides...

How to Create a MySQL Database in cPanel

Creating a MySQL database in cPanel is a straightforward process. Follow these steps to set up a...