LochStudios  /  Help Centre  /  cPanel  /  Choose your PHP version

Choose your PHP version

Pick the PHP version each domain or folder on your shared hosting uses, and turn extensions on from cPanel.

Updated

PHP is the language most sites on our shared hosting run on, including WordPress. You can use more than one version on the same account: a current 8.x on the live site, and another version on a subdomain while you test.

This article is for Beginner and Standard shared hosting. Open cPanel from the portal. Do not guess a hostname.

On a VPS you install and switch PHP yourself. See Install PHP and Common Extensions.

Open cPanel

  1. Sign in at the portal.
  2. Open the hosting service for the site.
  3. Click Log in to cPanel.

Change the version

In the Software section, open Select PHP Version (some themes label it PHP Selector). That is the usual tool on our shared hosting, and it is where you turn extensions on.

If the account also shows MultiPHP Manager, you can set a version per domain there instead. Use one tool for a given domain so the two do not fight.

Select PHP Version

  1. Open Select PHP Version.
  2. Note the version marked as current.
  3. If the page lets you pick a domain or folder, choose the document root you want to change (public_html for the main site, or the addon / subdomain folder).
  4. Choose a version from the list.
  5. Click Set as current or Apply.

The change applies to that folder and its children, unless a child folder has its own version.

MultiPHP Manager

If you opened MultiPHP Manager:

  1. Tick the domain, addon domain, or subdomain you want to change.
  2. Choose a version from the PHP Version list.
  3. Click Apply.

That version applies to the whole domain. Different domains on the same account can run different versions, which helps when you migrate one site at a time.

Extensions and PHP options

After you set a version in Select PHP Version, stay on that page.

  • Extensions: tick the modules the site needs. Common ones are mysqli, pdo_mysql, gd, mbstring, curl, zip, intl, and opcache. Save if the page has a save control.
  • Options (or Switch to PHP Options): raise memory_limit, max_execution_time, or upload_max_filesize here when a script needs more room. Save when you finish.

If you set the version in MultiPHP Manager, open MultiPHP INI Editor under Software and edit those same settings for that domain.

Do not upload a custom php.ini into public_html unless we have asked you to. The selector is the supported path.

If you moved the site from another host, check .htaccess for old PHP handler lines (AddHandler, AddType, or suPHP_ConfigPath). Those can pin an old version and ignore the selector. Remove them, or open a support ticket and we will check the file with you.

Check which version is running

The current version is at the top of Select PHP Version, or next to the domain in MultiPHP Manager. Start there.

Need the site itself to confirm it (for example after you pointed a subdomain at another folder)?

  1. Open the File Manager.
  2. Go to that site's document root.
  3. Create a file named phpinfo.php that contains only:
<?php phpinfo();
  1. Visit https://yourdomain.com/phpinfo.php (use the real domain or subdomain).
  2. Confirm the PHP version and that the extensions you enabled are listed.
  3. Delete phpinfo.php as soon as you have looked. It exposes account details.

Use https when the name already has a certificate. AutoSSL issues one from SSL/TLS Status once the name points at this hosting.

Before you switch a live site

  • Backup: we keep hourly copies of the account. Take your own copy as well if you are about to change a production site. See Download and Restore a Backup.
  • Test first: add a subdomain, copy the site into that folder, and set that folder to the new version. Fix warnings there before you change the main domain.
  • WordPress: update WordPress, themes, and plugins first. Prefer WordPress Toolkit or Installatron for the install itself. See Install WordPress.
  • Read the error log: after a switch, open Errors under Metrics. A parse error or a missing function name tells you what to turn on or update.

Which version to pick

The dropdown is the list this server actually offers. Use that list, not a version copied from an old guide.

What you see in the listWhat to do
Newest 8.xDefault for new sites and for WordPress that is up to date
An older 8.xFine if an app or plugin is not ready for the newest listed version
7.x (if it is still listed)Only while you update a legacy app. Do not start a new site here

Newer PHP is faster and still receives security fixes. Stay on the newest version the site actually runs. If you are still on 7.x, plan the move.

If the version you need is not in the list, open a support ticket.

If the site breaks after a change

  1. Switch the domain or folder back to the previous version so visitors see the site again.
  2. Check Errors for a parse error or a missing function. Turn on the matching extension if that is the cause.
  3. For WordPress, see Fix the WordPress White Screen of Death / HTTP 500 and Fix a 500 Internal Server Error.
  4. Confirm cron jobs still run. A job that calls php follows the account version. The website can use a different per-folder version. If a scheduled script stops after the change, put the version back or open a support ticket.

If you are unsure which version the application needs, open a support ticket and we will help.

Related


Was this article helpful?

← Back to cPanel