Skip to main content

Identify all users assigned a PHP version

Comments

12 comments

  • Infopro
    This thread may be helpful:
    0
  • bloatedstoat
    @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
  • cPanelLauren
    There isn't a native way but that command they provide in there will get that done for you.
    0
  • Infopro
    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
  • bloatedstoat
    @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
  • cPanelLauren
    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
  • bloatedstoat
    Thanks @cPanelLauren and thanks to the genius in the cPanel colony. Appreciated.
    0
  • SS-Maddy
    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
  • Bob Gordon
    selectorctl --list-users --version=5.6
    will show all users on PHP version you specify!
    0
  • jonathan.mann
    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
  • cPanelAnthony
    Hello! As long as you're using EasyApache 4, you should be able to utilize "MultiPHP Manager" in WHM.
    0
  • jonathan.mann
    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.