Change PHP Versions in CyberPanel

Change PHP Versions in CyberPanel

Knowing how to change PHP versions for PHP website hosting is important because a new version releases at least annually. However, sometimes you may need to use an older PHP version until one of your web applications releases an update to support the latest version. Other times you might just need to increase the system resources that can be used for certain PHP operations. Fortunately, CyberPanel allows you to configure different PHP configurations for separate websites.

Change PHP Versions for Websites

CyberPanel installs multiple PHP versions by default so you don’t need to install them manually. These steps will guide you through changing PHP versions for one website at a time.

  1. Log into CyberPanel.
  2. On the left, select Websites > List Websites.
  3. On the right-side of a domain, select Manage.
  4. Under Configurations, select Change PHP.
  5. Select a different PHP version from the drop-down menu and select the Change PHP button underneath it.

Install PHP Extensions

It is generally recommended to uninstall anything you don’t need on a system. Each PHP version comes with dozens of extensions installed by default. Here’s how to install and uninstall extensions for each PHP version.

  1. On the left, select PHP > Install Extensions.
  2. Select a PHP version from the drop-down menu.
  3. Select Install or Uninstall next to a PHP extension in the list.
    PHP extensions in CyberPanel
  4. Once the bottom of the progress window reads PHP Extension Installed or PHP Extension Removed, select Go Back.

How to Edit php.ini

Sometimes, having the correct PHP version for your website is not enough. Some applications require a higher allotment of memory for resource-intensive operations or file upload size for larger files to meet your demands. Below are two ways to configure PHP settings including memory limit, max execution time, and upload max file size.

  1. Select PHP > Edit PHP Configs.
  2. Select a PHP version from the drop-down menu.
  3. Make changes as needed.
    Edit php.ini in CyberPanel dashboard
  4. At the bottom, Save Changes.
  5. Restart PHP.

Advanced Editor

If you need to make more in-depth changes, you can edit the raw php.ini file in CyberPanel. This is helpful because not all options you might need will always be available in the admin dashboard.

  1. Select PHP > Edit PHP Configs.
  2. At the top, select Advanced.
  3. Select a PHP version from the drop-down menu.
  4. Edit the php.ini file in the text window.
    Edit php.ini file in CyberPanel
  5. Save Changes at the bottom.
  6. Restart PHP.

Check PHP Changes with phpinfo.php

The “phpinfo” PHP function generates a page listing information about a particular PHP version configuration on your system. Helpful info includes the full file path to the php.ini file and variations between server settings and a specific user’s custom settings for a PHP version.

The common usage is to name the file “phpinfo.php” but some bots search for this file as reconnaissance before cyber attacks. Therefore, below we recommend being creative with the filename. 

  1. From the dashboard, select Websites > List Websites > File Manager. Or, log into the CyberPanel VPS with FTP or SSH.
  2. Enter the public_html directory.
  3. Create a new file titled “phpcheck.php,” or something creative, and edit it.
  4. Add the following:
    <?php phpinfo(); ?>
  5. Save the file.
  6. Open the file in a web browser (e.g. example.com/phpcheck.php).
Create phpinfo Page

Learn more about how to manage your CyberPanel server.

If you don’t need cPanel, don't pay for it. Only pay for what you need with our scalable Cloud VPS Hosting.

check markCentOS, Debian, or Ubuntu check markNo Bloatware check markSSH and Root Access

InMotion Hosting Contributor
InMotion Hosting Contributor Content Writer

InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals!

More Articles by InMotion Hosting

2 thoughts on “Change PHP Versions in CyberPanel

  1. It would have been helpful if I could find “On the left, select Websites > List Websites.”
    But since there is no “Websites” among my headings on the left, I roamed hopelessly around looking for how to do a simple PHP update. The only dropdown options I found were for old PHP. Maybe a screenshot of what we are supposed to see. Still looking. Still can’t find how to update. Still getting messages on my website every day telling me I need to update.

    1. It sounds like you may be running an older version of CyberPanel, in which case these steps would differ. Your dashboard should resemble this:
      View of CyberPanel

      If it does not look like that, you may have to Upgrade CyberPanel before you can follow this guide.

Was this article helpful? Join the conversation!