๐Ÿงฉ PHP Selector Management on cPanel + CloudLinux 9.5

How to Manage PHP Versions with CloudLinux PHP Selector on cPanel
Tested Environment: CloudLinux 9.5 + cPanel


๐Ÿ”„ Switch Users from Native PHP to a Specific Version

To migrate all users currently using native PHP to a specific version (e.g., PHP 7.4), run:

selectorctl --change-to-version=7.4 --version=native

๐Ÿ’ก Replace 7.4 with the target PHP version (e.g., 5.6, 8.1, etc.).


๐ŸŒ Set a Default PHP Version for New Accounts

To make PHP 5.6 the default version for all newly created cPanel accounts:

selectorctl --set-current=5.6

๐Ÿ“Œ This only applies to new users added after the command is run. It will not affect existing users.


โœ… View Available PHP Versions

To list all PHP versions installed on the server:

selectorctl --list-available

To list only enabled versions:

selectorctl --list-enabled

โš™๏ธ Enable or Disable Specific PHP Versions

Enable PHP 5.6 in the selector:

selectorctl --enable=5.6

Disable PHP 7.3 from the selector:

selectorctl --disable=7.3

๐Ÿ” Sync PHP Configuration for All Users

After making version changes, apply the updates to all existing users:

selectorctl --sync-users

Example Use Case:
If youโ€™ve just enabled PHP 8.2 and want all native users moved to it and future users to default to 8.2:

selectorctl --enable=8.2
selectorctl --change-to-version=8.2 --version=native
selectorctl --set-current=8.2
selectorctl --sync-users
Scroll to Top