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

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.

Advertisement

To set all site to use alt-PHP 7.4, run

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

cd /var/cpanel/users
ls -1 | awk '{ print "selectorctl --set-user-current=7.4 --user="$1 }' | sh
Add a comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Advertisement