php selector and mod_fcgid and mod_lsapi per account?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • oceanwave
    Member
    Forum Explorer
    • Dec 2024
    • 48

    #16
    Actually, it appears it is ignoring what is set for an individual php version at the bottom -- only the setting for ea-php php handler lsapi or cgi is determining what the php handler is for the alt php versions.

    If I set
    ea-php83: lsapi
    alt-php83: lsapi
    site running alt-php83 though php selector phpinfo shows: lsapi V8.3 Cloudlinux 1.3

    If I set
    ea-php83: cgi
    alt-php83: lsapi
    site running alt-php83 though php selector phpinfo shows: CGI/FastCGI

    If I set
    ea-php83: lsapi
    alt-php83: cgi
    site running alt-php83 though php selector phpinfo shows: lsapi V8.3 Cloudlinux 1.3

    (same substituting alt-php73 for alt-php83)

    So it appears on two servers, whatever the php handler for the default php version is set to is being applied to the alt-php versions ignoring what the individual alt-php version is set to use for the handler, fastcgi (cgi) or lsapi (lsapi)

    Comment

    • oceanwave
      Member
      Forum Explorer
      • Dec 2024
      • 48

      #17
      Under whm/cpanel MultiPHP Selector, it appears to work if under the User Domain Settings tab I uncheck "inherit" and select the php version there, instead of the way I've been selecting php version for years in cloudlinux selector.

      For many years I've been using the cloudlinux PHP Selector to select php version, extensions, and options for individual cpanel accounts. The PHP Selector was the only option before cpanel added the MultiPHP Manager to do this; I've been using the Cloudlinux PHP Selector for a long time (and like it) so I hesitate to change... not sure how that would go with existing account settings without messing things up like php settings and extensions set under selector.

      So now I'm still using the Cloudlinux Selector to select the php version/extensions/options per cpanel account. This works as long as I leave the "inherit" checked under WHM's MultiPHP Mananger, but then the php handler is ignored.

      If I uncheck "inherit" and set the php version under the Domain Settings tab of the MultiPHP Manager instead of in selector, the php handler selection fast cgi (cgi) or lsapi (lsapi) is honored, but then the php version selected in selector is ignored... under the cpanel account the selector (php selector) shows version/extensions settings for php version account is not running. So it appears if I wanted the php handler per alt-php version, I'd have abandon using the cloudlinux php selector (which I would miss) and change entirely to using the cpanel multi php manager instead. But what would happen to all account settings currently set via the cloudlinux php selector in that case (extensions enabled or limit setting sset for certain accounts for example in cloudlinux selector)

      Comment

      • bogdan.sh
        Administrator
        • Nov 2016
        • 1308

        #18
        You've got it diagnosed right, and there's a clean fix that won't lose any of your per-account settings.

        With mod_lsapi, the handler is set by your system-default PHP version, and alt-php (PHP Selector) sites inherit it. So if ea-php83 is on cgi/fcgid, everything - including alt-php - is served as CGI/FastCGI. Set the system-default ea-php handler to lsapi and the alt-php sites follow. That's exactly what you saw. It's documented under the PHP Selector requirements: "An appropriate PHP handler is selected for the PHP version which is the system version." https://docs.cloudlinux.com/cloudlin.../#php-selector

        The two tools are meant to work together, not either/or:
        • Keep domains on "Inherit" in MultiPHP Manager. That hands version control to PHP Selector, so all your users' choices stay exactly as they are - nothing to lose.
        • In MultiPHP Manager, set the handler for the system-default ea-php to lsapi. The handler is a version-level setting, so changing it doesn't touch any per-account version.

        Result: PHP Selector keeps managing versions per account, and every site (ea-php and alt-php) runs through lsapi.

        Rbout "Total domains: 0"

        That just counts domains actually served by lsapi. It was 0 because the active handler wasn't lsapi yet. Once you switch the default handler, it'll climb.


        Quick checklist
        1. MultiPHP Manager → Handlers: set system-default ea-php to lsapi.
        2. Leave domains on "Inherit".
        3. Verify: apachectl -M | grep -i lsapi and rpm -q liblsapi.
        4. Check phpinfo() - Server API should read lsapi, and the domain count should rise.
        5. Still CGI/FastCGI on one site? Check its .htaccess for a forced handler.

        There's no per-account handler switch - the handler is global to the PHP version. So the path above (lsapi as system handler + Inherit) is the way to go.

        Hope that helps!

        Comment

        • oceanwave
          Member
          Forum Explorer
          • Dec 2024
          • 48

          #19
          Thanks.

          So, if I understand correctly, it's working as designed and I can set a different php handler per individual alt-php-version ONLY if I do not use php selector for the cpanel account wanting to do this.

          Uncheck "inherit" and stop using php selector for one account and that one account will then (and only then) use the php handler set in MultiPHP Manager for the php version it is using instead of the version set for the system default php version. The caveat is that I would have to be sure that the individual php extensions/options set under that account's php selector are somehow maintained either through the system defaults or another means if switching to using MultiPHP Manager only for that account, or else I might be hit by the account changing to default extensions/settings and having a limit that doesn't work for the site or an extension missing causing it to break.

          OR

          Set the php handler ONLY system-wide for the default php version (which then applies to all php versions) and continue using php selector to set php version, extensions, and options under each account.


          My original desire was to test using mod_lsapi on a site or a couple sites first, before changing system-wide to evaluate and be sure everything was running smoothly. I haven't used mod_lsapi before so I was curious to give it a try without committing all sites to it right away. I notice when I switch back and forth there is a 30-second or so window where php scripts result in 404 errors, etc. during the switch, so I didn't want to do too much switching back and forth system-wide to evaluate. Maybe the only way to evaluate though is to run one server with system-wide fcgid (cgi) and one server with system-wide mod_lsapi though.

          Comment

          • bogdan.sh
            Administrator
            • Nov 2016
            • 1308

            #20
            That's the right read. The handler is global to the PHP version, so there's no clean per-site lsapi pilot without pulling those accounts out of PHP Selector.

            A separate test server is the safest way to evaluate. If you'd rather test on the live box, switching the handler to lsapi mostly causes a brief Apache reload rather than real downtime - so a low-traffic window usually keeps disruption minimal. Either way, glad it's sorted!

            Comment

            Working...