Cpanel CloudLinux set all users to use alt-php
If your cpanel server have cloudlinux + PHP Selector installed, you need to set all site to use inherit PHP before you can use PHP Selector.
This can be done in MultiPHP Manager or using command line
1 |
for i in $(cut -d: -f1 /etc/userdatadomains );do whmapi1 php_set_vhost_versions version=inherit vhost-0=$i;done |
Tis command will set all web sites to use inherit PHP.
To set all site to use alt-PHP 7.4, run
1 |
selectorctl --change-to-version=7.4 --version=native |
This will change PHP version for all sites that use native PHP to alt-PHP 7.4
Or you can use
1 2 |
cd /var/cpanel/users ls -1 | awk '{ print "selectorctl --set-user-current=7.4 --user="$1 }' | sh |
See cloudlinux