Logo
Bearhost Logo

How to Manage PHP Versions in cPanel

By Elliot, BearHost·

Running the right PHP version is important for security, performance, and compatibility. This guide covers checking, switching, and managing PHP versions in cPanel.

Check Your Current PHP Version

Via cPanel MultiPHP Manager

  1. Log in to cPanel
  2. Go to Software > MultiPHP Manager
  3. Your domain and its current PHP version are listed

Via WordPress Site Health

  1. Go to Tools > Site Health > Info > Server
  2. Look for PHP version

Via Command Line (Terminal)

php -v

Switch PHP Versions

  1. Go to cPanel > Software > MultiPHP Manager
  2. Check the box next to your domain
  3. Select the desired PHP version from the dropdown
  4. Click Apply

Changes take effect immediately.

Available PHP Versions

| Version | Status | Support Until | Notes | |---|---|---|---| | PHP 7.4 | End of Life | Dec 2022 | Security risk — upgrade immediately | | PHP 8.0 | End of Life | Nov 2023 | Security risk — upgrade soon | | PHP 8.1 | Security fixes only | Dec 2025 | Stable, widely compatible | | PHP 8.2 | Active support | Dec 2026 | Recommended for most sites | | PHP 8.3 | Active support | Dec 2027 | Latest stable, best performance |

Recommendation: Use PHP 8.2 or 8.3 for the best balance of performance and compatibility.

Before Upgrading: Check Compatibility

Check Plugin and Theme Requirements

  • Visit each plugin and theme's page on wordpress.org
  • Look for "Requires PHP" in the sidebar
  • Check the support forum for reports of PHP 8.x issues

Use PHP Compatibility Checker Plugin

  1. Install PHP Compatibility Checker from the WordPress plugin directory
  2. Go to Tools > PHP Compatibility
  3. Select the target PHP version
  4. Click Scan site
  5. Review any warnings or errors

Test on a Staging Site

Before switching PHP on your live site:

  1. Create a staging copy (see our staging guide)
  2. Switch the staging site to the new PHP version
  3. Test all pages, forms, checkout, and plugin features
  4. If everything works, switch the live site

Common Migration Issues

PHP 7.4 to 8.0

  • each() function removed — older plugins may break
  • Stricter type checking — some code that worked may throw errors
  • create_function() removed — affects old themes

PHP 8.0 to 8.1

  • FILTER_SANITIZE_STRING deprecated
  • Return types enforced in internal classes
  • Fibers introduced (no action needed)

PHP 8.1 to 8.2

  • Dynamic properties deprecated (common in older plugins)
  • Readonly classes introduced
  • utf8_encode() and utf8_decode() deprecated

PHP 8.2 to 8.3

  • Generally smooth transition
  • Typed class constants introduced
  • json_validate() function added

Manage PHP Extensions

  1. Go to cPanel > Software > MultiPHP INI Editor
  2. Select the Editor Mode tab
  3. Choose your domain
  4. You can enable or disable PHP extensions here

Common extensions needed for WordPress:

  • mysqli (database)
  • curl (API calls)
  • gd or imagick (image processing)
  • mbstring (multibyte strings)
  • xml (RSS feeds, sitemaps)
  • zip (plugin/theme installation)
  • intl (internationalisation)

Different PHP per Subdomain

MultiPHP Manager lets you set different PHP versions per domain and subdomain. This is useful when:

  • A staging subdomain needs a newer PHP version for testing
  • An older application on a subdomain requires PHP 7.4
  • You want to test PHP 8.3 on a subdomain before switching the main site

Cron Job PHP Paths

When running cron jobs, you may need to specify the PHP version explicitly:

# System default PHP
/usr/local/bin/php /home/user/script.php

# Specific PHP version (EA4)
/usr/local/bin/ea-php82 /home/user/script.php
/usr/local/bin/ea-php83 /home/user/script.php

Rolling Back

If the new PHP version causes problems:

  1. Go to MultiPHP Manager
  2. Switch back to the previous version
  3. The change is instant — your site will work again immediately
  4. Investigate compatibility issues before trying to upgrade again
Tags:#cpanel#php#php-version#multiphp#compatibility#upgrade