Panellicense

Fix 'Cannot manage PHP versions' when CageFS is disabled

Resolve the CloudLinux PHP Selector error by removing pam_lve from sudo, rebuilding CageFS, and enabling CageFS for the affected user.

4 min readUpdated 2026-05-16php-selector · cagefs · cpanel · pam_lve
schema: HowToschema: FAQPage

The CloudLinux PHP Selector error "Cannot manage PHP versions: CageFS is disabled" looks like a single problem but covers three distinct failure modes. They have to be ruled out in order — the diagnostic for each one masks the next.

The audience here is a sysadmin staring at a customer ticket. Skip the explainer; below is the decision tree and the exact commands.

1. pam_lve in /etc/pam.d/sudo blocks the switch

The Selector enters the user's cage via sudo to swap interpreters. If pam_lve.so is loaded for the sudo stack, the LVE wrapper short-circuits the cage entry and the Selector reports CageFS disabled — even though CageFS is fine.

grep pam_lve /etc/pam.d/sudo

If the line exists, comment it out:

sed -i 's/^\(.*pam_lve.*\)/#\1/' /etc/pam.d/sudo

No service restart needed — PAM rereads on the next sudo invocation. Reload the PHP Selector page in cPanel. If the error persists, move to step 2.

2. CageFS is not enabled for the affected user

CageFS can be enabled globally but disabled per-user. Check the user's status:

cagefsctl --user-status username

Expected output: Enabled. If it reads Disabled, enable it:

cagefsctl --enable username

A bulk fix for "every user should be caged" is cagefsctl --enable-all. Note this only flips the toggle — it doesn't rebuild the cage skeleton, which is step 3.

To audit who's outside the cage:

cagefsctl --list-disabled

A long list usually means a previous admin used the WHM-level toggle to turn CageFS off for "convenience". Re-enable per user and audit shell sessions for hardcoded paths that broke.

3. CageFS skeleton is broken or missing

The cage skeleton is the read-only set of bind mounts and base files under /usr/share/cagefs-skeleton/. If a yum transaction was interrupted, or someone deleted files thinking they were stale, the cage mounts incompletely and the Selector reports disabled.

Symptom: cagefsctl --user-status username says Enabled but switching PHP versions still fails. Look for Cannot mount or Skeleton incomplete lines in /var/log/messages.

Rebuild the skeleton and remount everyone:

cagefsctl --force-update
cagefsctl --remount-all

--force-update repopulates the skeleton from the installed RPMs. --remount-all re-binds every active user cage against the rebuilt skeleton. On a server with 200 users this takes 2-3 minutes; sessions hold during the remount.

Verify the user is now properly caged:

cagefsctl --user-status username
su - username -c 'ls /etc'   # should show the limited cage view, not the host /etc

If the second command shows the host's full /etc (with files like shadow), the cage is not active — go back to step 2.

Confirm PHP Selector works

Once all three are clean, in cPanel Select PHP Version loads without the error and the dropdown is populated. From the command line, the user-facing wrapper should return the alt-php interpreter:

su - username -c 'which php'
# /usr/bin/php  (the alt-php wrapper, not /opt/cpanel/ea-phpXX/...)

If you haven't configured the Selector at all yet, the full setup is in the CloudLinux PHP Selector setup guide. If CageFS itself isn't installed because CloudLinux was added after cPanel, work through install CloudLinux on cPanel first — the PHP Selector depends on a working CageFS layer.

Why does PHP Selector say CageFS is disabled when it isn't?+
Usually pam_lve.so loaded in /etc/pam.d/sudo. The Selector uses sudo to enter the user's cage; pam_lve short-circuits the entry and the Selector misreports it as disabled. Comment out the line in the sudo PAM stack only.
How do I check if a user is in CageFS?+
Run cagefsctl --user-status username — it returns Enabled or Disabled. Confirm with su - username -c 'ls /etc'; the caged view shows a limited /etc, not the host's full one.
Does cagefsctl --remount-all break active SSH sessions?+
No. Existing sessions hold through the remount. On a server with 200 users the operation takes 2-3 minutes and is safe to run during business hours.
Can I disable CageFS for one user without disabling it globally?+
Yes — cagefsctl --disable username. Do this sparingly; users outside CageFS share the host filesystem view and undo most of CloudLinux's tenant isolation.

Next steps

Switch in an afternoon

Switch from your current reseller — free.

We migrate active cPanel, Plesk, LiteSpeed and CloudLinux licenses from any reseller. We prorate the first month so you never pay twice, and your customers see zero downtime during the swap.