Identify all users assigned a PHP version
Hello,
We use the CloudLinux PHP selector to assign a PHP version.
Is it possible, without having to plough through each username individually, all users currently assigned PHP v5.6 for example?
I can see how this is done on a per account basis but I am seeking a list of all users assigned a PHP version. It's really time consuming doing this per account and I am inherently lazy so looking for the path of least resistance. Command line preferably.
Thanks.
-
@Infopro I read that article too before chipping in here. Bar anyone else piping up on this you've pretty much confirmed to me that there is no native method. Thanks mate. 0 -
There isn't a native way but that command they provide in there will get that done for you. 0 -
We use the CloudLinux PHP selector to assign a PHP version.
MultiPHP Manager in WebHost Manager makes doing what you seek, rather trivial. I assume you already know this.0 -
@Infopro In my case every domain displays PHP5.6 in MultiPHP Manager in WHM. The versions actually deployed are mostly version 7 by way of the CloudLinux PHP Selector chosen in cPanel. I've never used MultiPHP Manager in WHM. @cPanelLauren thanks, it does in a fashion. My knowledge of command line voodoo is limited, ideally I'd like a command that displays all users of a "chosen" version listed next to just the username. The output from the one on the CL forum is overly verbose and cluttered - especially when dealing with lots of accounts. I'm sure there's a way to do this ... he said whilst throwing down the gauntlet .... 0 -
Hi @bloatedstoat How about this? for user in /var/cpanel/users/*;do if [[ ! "${user##*/}" = system ]]; then php="$(selectorctl -c -u "${user##*/}" 2>&1)";echo "${user##*/} ${php%%$'\t'*}";fi;done
I can't take all the credit for this though, one of my coworkers is a genius with one-liners like this.0 -
Thanks @cPanelLauren and thanks to the genius in the cPanel colony. Appreciated. 0 -
Hi @bloatedstoat How about this?
for user in /var/cpanel/users/*;do if [[ ! "${user##*/}" = system ]]; then php="$(selectorctl -c -u "${user##*/}" 2>&1)";echo "${user##*/} ${php%%$'\t'*}";fi;done
I can't take all the credit for this though, one of my coworkers is a genius with one-liners like this.
Loved this. Tweeted too :)0 -
selectorctl --list-users --version=5.6
will show all users on PHP version you specify!0 -
I'm in a similar situation as the OP. I'm working with CentOS servers. Is there a version of selectorctl that I can use for say, CentOS 6? 0 -
Hello! As long as you're using EasyApache 4, you should be able to utilize "MultiPHP Manager" in WHM. whmapi1 php_get_vhost_versions | egrep 'account:|version:|vhost:' | sed 's/vhost/domain/'
Can I include some kind of modifier in this to only list active accounts/domains?0
Please sign in to leave a comment.
Comments
12 comments