PHP Selector
The CloudLinux PHP Selector lets you choose which version of PHP your site runs, enable or disable PHP extensions, and adjust php.ini settings — all from within cPanel.
Changing Your PHP Version
- Log into cPanel.
- Scroll to the Software section.
- Click Select PHP Version.
- Use the dropdown at the top of the page to choose the PHP version you want (e.g., 8.1, 8.2, 8.3).
- Click Set as current to apply the change.
Enabling and Disabling PHP Extensions
PHP extensions add extra functionality to PHP, such as database drivers, image processing libraries, and encryption tools. You can toggle individual extensions on or off.
- Go to Select PHP Version in cPanel.
- Make sure you have the correct PHP version selected at the top.
- Below the version selector, you'll see a list of available extensions with checkboxes.
- Check the box next to any extension you want to enable, or uncheck it to disable.
- Click Save to apply your changes.
Commonly needed extensions include:
- mysqli / pdo_mysql — Required for WordPress and most PHP applications that use MySQL databases.
- gd / imagick — Image processing libraries used for thumbnail generation and image manipulation.
- curl — Allows PHP to make HTTP requests to external APIs and services.
- mbstring — Multi-byte string support, required by most modern PHP applications.
- zip — Enables creating and extracting ZIP archives from PHP.
- intl — Internationalization support for formatting dates, numbers, and currencies.
- opcache — Caches compiled PHP scripts in memory for faster execution.
Adjusting php.ini Values
You can adjust PHP configuration values like memory limits, upload sizes, and execution times directly from the PHP Selector.
- Go to Select PHP Version in cPanel.
- Click the Options tab (or link) near the top of the page.
- Locate the setting you want to change and enter the new value.
- Click Save to apply.
Common settings you may need to adjust:
- memory_limit — Maximum memory a PHP script can use (default: 256M). Increase if you see "Allowed memory size exhausted" errors.
- upload_max_filesize — Maximum size of an uploaded file (default: 64M). Increase if you need to upload large files through your application.
- post_max_size — Maximum size of POST data. Should be equal to or larger than
upload_max_filesize. - max_execution_time — Maximum time in seconds a script can run (default: 30). Increase for long-running import or export tasks.
- max_input_vars — Maximum number of input variables accepted per request (default: 1000). Some page builders and complex forms need this increased to 3000 or higher.
- display_errors — Set to
Onfor development/debugging,Offfor production sites.
php.ini or .user.ini file in your site's document root (usually public_html). Settings defined there override the defaults for that directory.
PHP Version Per Domain
If you host multiple domains on your account, the PHP version set through the PHP Selector applies to all domains by default. To use a different PHP version for a specific domain, you can add the following to the .htaccess file in that domain's document root:
<IfModule mime_module>
AddHandler application/x-httpd-alt-php82___lsphp .php
</IfModule>
Replace php82 with the version you want (e.g., php81 for PHP 8.1, php83 for PHP 8.3). The exact handler name may vary — contact support if you need help setting this up for a specific domain.