UnderHost
Knowledgebase Docs

Change PHP version in cPanel with CloudLinux PHP Selector

An illustrated guide to Select PHP Version: account and per-domain PHP versions, extensions, all PHP options, upload limits, testing, and rollback.

On this page

Use Software → Select PHP Version in cPanel to open CloudLinux PHP Selector. It lets you choose a PHP version, enable extensions, and adjust PHP options. Where Per Domain Settings is available, you can also give an isolated domain its own configuration.

Which PHP tool should I use? This guide covers CloudLinux PHP Selector, shown in the screenshots. If your account uses MultiPHP Manager, follow our MultiPHP guide. These tools can control different PHP handlers; changing one does not guarantee that a domain uses its settings.

Before you change PHP

  • Back up your website files and database. See cPanel backups.
  • Check the PHP requirements of your application, themes, plugins, and any encoded software. Test an upgrade on a staging copy when possible.
  • Record the current version, enabled extensions, and custom option values for the account or domain you will change.
  • Choose a maintained version compatible with your application. A legacy version appearing in the list is not a recommendation to use it. Ask support about the maintenance coverage of an older runtime if your application still requires it.

The screenshots show an example account using PHP 7.4. Versions, defaults, available extensions, and allowed values vary by server and PHP version; do not copy the screenshot values as universal recommendations.

1. Open PHP Selector

  1. Log in to cPanel.
  2. Scroll to Software, or search for Select PHP Version in the tool search.
  3. Click Select PHP Version.
cPanel Software section with Select PHP Version beneath PHP PEAR Packages
Select PHP Version opens the CloudLinux PHP Selector. Select any screenshot to view it at full size.

2. Change the account PHP version

  1. Open Account Global Settings if your interface shows that tab.
  2. Find the PHP version dropdown. The active version is marked (current).
  3. Select the version required by your application. If your interface displays Set as current, Apply, or a confirmation, complete it.
  4. Wait for the success message, then reload the selector and check which version is marked current.
  5. Review the Extensions and Options for that version, then test your websites.
PHP Selector version dropdown showing PHP versions and a native server version
The version list belongs to this example server. Select the version your application supports.

Account scope: Non-isolated domains use the account global settings shown in this interface. A global change can therefore affect several websites. Domains with their own isolated settings must be checked separately.

What does native mean? Native selects the server-provided PHP runtime rather than a selected CloudLinux Alt-PHP version. The version shown beside native is server-specific. Selector extension and option controls may be unavailable for native PHP; ask support which tool manages your domain before switching.

3. Use a different PHP version for one domain

In the supplied interface, Per Domain Settings offers site isolation: a domain receives its own filesystem isolation and PHP configuration. When enabled, it initially inherits the current account settings; subsequent changes are independent.

  1. Open Per Domain Settings.
  2. Find the intended domain and check its isolation status.
  3. Use that domain's isolation control if you need independent PHP settings. Avoid Enable Isolation for All when you only intend to change one website.
  4. Open the isolated domain's PHP controls and select its version, extensions, and options.
  5. Confirm the saved values and test that domain, including login, uploads, forms, and any integrations.
PHP Selector Per Domain Settings showing isolated and non-isolated domain counts and bulk isolation controls
Per Domain Settings separates isolated sites from websites using the account configuration.

Disabling isolation returns a domain to account-level settings. Record its independent values before doing so and verify the account configuration first. If this tab or the domain controls are missing, contact support to confirm the options available on your server.

4. Enable the PHP extensions your site needs

Choose the correct account or domain scope and PHP version, then open Extensions. Check a required extension to enable it or uncheck an optional extension to disable it. Complete any save prompt and confirm the change. Pale or disabled checkboxes can represent built-in or non-editable modules.

Common application requirements include mysqli or pdo_mysql for MySQL, mbstring and intl for text processing, curl for HTTP requests, gd or imagick for images, and zip for archives. Enable what your application requires; extension availability and compatibility depend on the selected version. Encoded applications may require a compatible ionCube or SourceGuardian loader.

Reset PHP Extensions to default restores the server's default extension selection for the selected context. It is not a website restore or a rollback of all custom PHP options. Record your selection before using it. See PHP extension troubleshooting.

5. Change PHP options

  1. Confirm the PHP version and account or domain scope.
  2. Open Options.
  3. Use a checkbox for an on/off setting, a dropdown for an allowed value, or a text field for a custom value.
  4. Finish editing and use any save or apply control your interface presents. Wait for confirmation, then reload to verify persistence.
  5. Change one setting at a time and test the affected feature.
PHP Selector Options tab showing error settings, uploads, include path, and execution time
General PHP options. The values shown are examples from this account.
PHP options for input limits, memory, OPcache, filesystem access, buffering, and sessions
Resource, cache, and session settings. A blank field or no value does not necessarily mean zero or disabled.

Use the units accepted by the field: size limits often accept K, M, or G; time limits use seconds. OPcache memory fields use numeric megabytes. Allowed values and server limits take precedence over examples below.

All available PHP options explained

This reference covers all 27 options supplied for this account. Keep existing values unless your application requirements or a diagnosed problem justify changing them.

General behavior and error handling

OptionMeaning and guidance
allow_url_fopenAllows URL-aware file functions to read remote resources. Some applications need it; it does not enable remote PHP includes or control cURL.
default_charsetDefault character encoding; normally UTF-8.
display_errorsPrints PHP errors in responses. Keep off on public sites; use logs for diagnosis so paths and other details are not exposed.
error_reportingSelects reported error levels. E_ALL includes all levels; display_errors and log_errors determine where they appear. Fix warnings rather than hiding them.
expose_phpControls PHP identification in response headers.
log_errorsWrites PHP errors to the configured log. Enable for troubleshooting and inspect error logs. This checkbox does not choose a log destination.
mail.force_extra_parametersForces extra parameters for the sendmail command used by PHP mail(), overriding the function's extra parameters. Leave unchanged unless support supplies a value; it does not configure SMTP authentication.
short_open_tagEnables legacy <? tags. Prefer <?php; <?= works independently.

References: PHP core settings, filesystem settings, error settings, and mail settings.

Uploads, input, and execution limits

OptionMeaning and guidance
file_uploadsPermits HTTP file uploads.
max_execution_timeScript execution timeout in seconds; the screenshot shows 30. Increase only for a known workload. On Unix, time spent in some system and stream operations is excluded; web-server timeouts can still apply.
max_file_uploadsMaximum files per request; example: 20.
max_input_nesting_levelMaximum depth of nested input arrays; example: 64.
max_input_timeTime allowed to parse request input. -1 uses max_execution_time; it is not a separate unlimited setting. Large uploads may need additional input time.
max_input_varsInput variable limit, applied separately to GET, POST, and COOKIE. Example: 1000. Large forms may be truncated when exceeded.
memory_limitPHP script memory ceiling; example: 128M. Hosting account limits still apply.
post_max_sizeTotal POST body limit, including files and fields. Keep above upload_max_filesize.
upload_max_filesizeMaximum size of one uploaded file.

References: PHP execution and input configuration and upload limits and pitfalls.

Paths, output, and sessions

OptionMeaning and guidance
include_pathSearch paths for includes. Keep version-specific defaults.
open_basedirRestricts accessible filesystem paths. Incorrect values break applications.
output_bufferingBuffers response output; numeric values specify bytes.
realpath_cache_sizeCache size for resolved filesystem paths.
realpath_cache_ttlResolved-path cache lifetime in seconds.
session.gc_maxlifetimeSeconds before stored session data becomes eligible for garbage collection. The example 1440 equals 24 minutes. Cleanup timing and application or cookie rules also matter; this is not a guaranteed login duration.
session.save_pathStorage location used by the session handler, usually a directory for file-based sessions. Keep the supplied writable path; an invalid path can break logins and carts.

The screenshots show .:/opt/alt/php74/usr/share/pear and /opt/alt/php74/var/lib/php/session. These belong to that PHP 7.4 configuration. Do not copy them into another runtime; retain its supplied paths or ask support. See core configuration and session configuration.

OPcache

OPcache stores compiled PHP code to reduce repeated compilation. These settings require OPcache to be available and enabled; changing a number does not itself enable the extension.

OptionMeaning and guidance
opcache.interned_strings_bufferMegabytes reserved for shared interned strings. Keep the server value unless measured usage justifies tuning.
opcache.max_accelerated_filesMaximum number of script keys cached; PHP chooses a supported internal capacity based on this value.
opcache.memory_consumptionMegabytes allocated to OPcache shared memory. This is separate from a script's memory_limit; availability depends on server configuration.

No value indicates that the interface is not showing an explicit value, not necessarily that caching is off. Confirm effective settings before tuning. See the official OPcache configuration reference.

Example: allow a larger upload

For an application that needs a single 64 MB upload, an example configuration is file_uploads = On, upload_max_filesize = 64M, and post_max_size = 80M, if those values are allowed. The larger POST limit leaves room for form data and upload overhead. For several files in one request, allow room for their combined size.

Set memory and time limits according to the application's workload rather than increasing every limit. Test a real upload. Application limits, available disk space, proxy limits, web-server timeouts, and CloudLinux account resources can still prevent it. See CloudLinux resource usage.

Verify the change and roll back if needed

  1. Reopen the selector and confirm the saved version and options in the correct scope.
  2. Check the runtime reported by your application's diagnostics. In WordPress, open Tools → Site Health → Info → Server.
  3. Test the homepage, administration login, forms, image processing, uploads, and checkout where applicable. Review fresh PHP errors.
  4. If the site breaks, return to the same account or isolated domain and select the previously working PHP version. Restore recorded extension and option values as needed.
  5. Retest and resolve incompatible plugins or application code before attempting the upgrade again.

A PHP version rollback does not undo database migrations or application updates; use the appropriate backup if those changed. Scheduled jobs and command-line PHP may use a separate executable, so verify them independently.

Troubleshooting

  • Select PHP Version is missing: Confirm that your plan and server provide PHP Selector. Do not install server software yourself on a shared account; ask support.
  • The site still reports the old version: Check the requested domain, isolation status, and whether its handler is managed by MultiPHP. An explicit handler or other server configuration may take precedence. Ask support before changing handler directives.
  • An option does not persist or take effect: Confirm the save succeeded and the selected scope is correct. Server restrictions, application overrides, or local configuration may affect the effective value.
  • A function or extension is missing: Recheck Extensions for the newly selected version. A module available on the old version may not exist on the new one.
  • White screen or HTTP 500: Check error logs, restore the prior runtime if needed, and inspect application compatibility. Keep public error display off.
  • Memory or timeout errors persist: PHP settings cannot raise your hosting plan's CPU, physical memory, process, or I/O allocation. See memory errors and execution timeout errors.
  • Logins fail after changing paths: Restore the recorded session path and filesystem settings, then retest.

When opening a support ticket, include the domain, selected PHP version, account or domain scope, changed options, exact error, and time of the failure. Include relevant log excerpts without passwords or session tokens.

Official references

For platform details, see CloudLinux Manager and control-panel integration and cPanel's PHP Selector and MultiPHP integration guidance. The screenshots illustrate UnderHost's interface; controls can differ between server versions.

Was this article helpful?

Need cPanel hosting or licensing?

Use UnderHost cPanel hosting or add cPanel/WHM to a VPS or dedicated server for familiar website, email, DNS, and database management.

Related articles

Back to cPanel