CloudLinux

Configure CloudLinux PHP Selector as root: versions, defaults and extensions

Set up CloudLinux PHP Selector for your users as root: install alt-php versions, choose the default version, default extensions and options, and fix selector issues.

AdvancedCloudLinux server (root)2 min read

CloudLinux PHP Selector lets each user pick their own PHP version and extensions in cPanel. As root you decide which versions are offered, which is the default and which extensions are on out of the box.

On MdmHost hosting plans this is managed for you. This guide is for administrators of their own CloudLinux cPanel server with root SSH access.

Before you start

  • CloudLinux with CageFS enabled; the selector only works for caged users (see managing CageFS).
  • Root access to WHM and SSH.

Install alt-php versions

Install the versions you want to offer with their common extensions, for example:

dnf -y groupinstall alt-php

This installs all available alt-php versions. To install one version only, install its packages, for example dnf -y install alt-php83 alt-php83-*. Afterwards update CageFS:

cagefsctl --force-update

Configure the selector in WHM

  1. Go to WHM → Plugins → CloudLinux Manager → PHP Selector (on some versions Selectors → PHP).
  2. Make sure the selector is Enabled.
  3. In the version list, tick the versions users may choose and untick ones you no longer support.
  4. Set the Default version for new users, for example 8.2.
  5. Click a version to edit its default extensions; tick what most sites need (mysqli, pdo_mysql, curl, gd, imagick, intl, mbstring, zip, opcache).
  6. Save.

Note: The native version is the server PHP from EasyApache. Users on native use MultiPHP settings instead of the selector (see the PHP Selector vs MultiPHP guide).

Default PHP options

Default values for options like memory_limit and upload_max_filesize come from each alt-php version's php.ini under /opt/alt/phpXX/etc/php.ini. Users can override them in their Options tab (see user-side extensions and options). After editing a default ini, run cagefsctl --force-update.

Manage users from SSH

selectorctl --list-users --version=7.4
selectorctl --set-user-current=8.2 --user=username

Use this to find users still on old versions before removing them, and to move them in bulk after testing. On recent CloudLinux versions, cloudlinux-selector offers similar JSON-based commands.

Warning: Before removing an old PHP version, tell affected users and move them to a newer version; their sites may break if they rely on old code.

Troubleshooting

Users do not see Select PHP Version

The selector is disabled, the user is not caged, or the feature is not in their feature list.

User's choice has no effect

The domain is pinned to a version in MultiPHP Manager. Set it to inherit (see PHP Selector vs MultiPHP).

Extension missing for a version

Install the package, for example alt-php83-pecl-redis, then update CageFS.

Frequently asked questions

Which default version should I choose?

A currently supported version that most of your customers' apps run on, such as PHP 8.2 or 8.3.

Does the selector work with LiteSpeed?

Yes. LiteSpeed runs the selected alt-php version through LSAPI automatically.

How do I offer a brand-new PHP release?

Install its alt-php packages when CloudLinux publishes them, update CageFS, enable the version in the selector and test it on a staging account before announcing it.

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.