php selector and mod_fcgid and mod_lsapi per account?

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

    #1

    php selector and mod_fcgid and mod_lsapi per account?

    Can I install both mod_fcgid and mod_lsapi with easyapache 4 and then use php selector or another means to select whether an account uses mod_fcgid or mod_lsapi as the php handler?
    Or would this be inadvisable?
    I'm interested in evaluating a switch from mod_fcgid to mod_lsapi and wondering if I need to
    1.) switch the server with easyapache from one to the other like I did when I changed from su_php to fcgid, or if there is a way to
    2.) switch individual account(s) over and observe before changing all accounts over
  • bogdan.sh
    Administrator
    • Nov 2016
    • 1273

    #2
    You can install both mod_fcgid and mod_lsapi with EasyApache 4, however, PHP handlers are typically configured globally for each PHP version within WHM MultiPHP Manager.

    This means if you set PHP 8.4 to use fcgi in WHM, all accounts using PHP 8.4 will utilize the fcgi handler. The PHP handlers are per PHP version, not per account.

    However, most likely you utilize both ea-php84 and alt-php84 and you can select different handlers for them:
    Click image for larger version

Name:	Screenshot_20250913_115202.png
Views:	359
Size:	23.6 KB
ID:	40725

    And then select eitner ea-php84 or alt-php84 in WHM > MultiPHP Manager > User Domain Settings tab, the dropdown list. You should give it a try.

    Comment

    • oceanwave
      Member
      Forum Explorer
      • Dec 2024
      • 33

      #3
      Awesome. Thanks.

      Any issue if I use Cloudlinux PHP Selector instead of MultiPHP Manager to set the PHP version per account for the last step?

      (Can I set MultiPHP Manager alt-php 7.4 -> lsapi, ea-php 8.3 -> cgi, and then use Cloudlinux PHP Selector to select alt-php 7.4 for an individual account to run mod_lsapi alt-php 7.4?)

      Comment

      • bogdan.sh
        Administrator
        • Nov 2016
        • 1273

        #4
        There is no way to select ea-php from PHP Selector in user panel, it will work only for alt-php versions. What should work is to set alt-php 7.4 -> lsapi then alt-php 8.3 -> cgi.

        Comment

        • oceanwave
          Member
          Forum Explorer
          • Dec 2024
          • 33

          #5
          Under the WHM MultiPHP Manager for each php version I'm only seeing the following three options:
          cgi
          lsapi
          none

          cgi is selected by default for each php version.

          However, whether I select cgi or lsapi for an alt-php version, php.info shows:
          Server API CGI/FastCGI

          I have the following apache modules installed under easyapache 4:

          Apache 2.4
          config
          config-runtime
          mod_bwlimited
          mod_cgid
          mod_deflate
          mod_expires
          mod_headers
          mod_hostinglimits
          mod_http2
          mod_lsapi
          mod_mpm_event
          mod_proxy
          mod_proxy_fcgi
          mod_proxy_http
          mod_proxy_wstunnel
          mod_remoteip
          mod_security2
          mod_ssl
          mod_suexec
          mod_unique_id
          mod_version
          tools

          What step have I missed?

          Comment

          • oceanwave
            Member
            Forum Explorer
            • Dec 2024
            • 33

            #6
            I selected the alt-php version using the cloudlinux php selector in the user account's cpanel.
            Under Multi-PHP Manager I do not have PHP-FPM installed and under user domain setting all accounts show inherit (the ea-php83)
            I've been using the cloudlinux php selector to select the alt php version, modules, and settings from within the individual cpanel account for years, so I have not used the WHM MultiPHP Manager much.

            Comment

            • bogdan.sh
              Administrator
              • Nov 2016
              • 1273

              #7
              Well, I see the mod_lsapi as a module, but do you have the liblsapi package? Do you have a green light in WHM > CloudLinux Manager home dashboard?

              Comment

              • oceanwave
                Member
                Forum Explorer
                • Dec 2024
                • 33

                #8
                Thanks very much,
                Originally posted by bogdan.sh
                Well, I see the mod_lsapi as a module, but do you have the liblsapi package?
                # rpm -q liblsapi
                liblsapi-1.1-86.el9.cloudlinux.x86_64

                # dnf list installed liblsapi
                This system is receiving updates from CloudLinux Network server.
                Installed Packages
                liblsapi.x86_64 1:1.1-87.el9.cloudlinux @cloudlinux-rollout-1

                # dnf list installed liblsapi-devel
                This system is receiving updates from CloudLinux Network server.
                Error: No matching Packages to list

                # apachectl -M | grep lsapi
                lsapi_module (shared)

                Originally posted by bogdan.sh
                Do you have a green light in WHM > CloudLinux Manager home dashboard?
                On the cloudlinux manager homepage (Shared Pro v.7.11.29-1), Mod_lsapi shows enabled (*) Green Dot
                LSAPI mod version 1.1-86
                LSAPI criu off
                LSAPI with connection pool off
                Criu status stopped
                Total domains 0

                PHP selector diagnostic says (Green) Success. There are 0 errors found. PHP Selector should work normally.

                I used easyapache 4 to install mod_lsapi. I did not do any command line install.

                https://cloudlinux.com/getting-start...configuration/ says that it can be installed though easyapache4 -- "Choose a predefined profile with mod_lsapi named with “+mod_lsapi” from WHM > Software > EasyApache 4." It doesn't say it will work by doing a custom easy apache 4 profile with mod_lsapi selected, but I thought that it would work (?)

                Beginner questions:
                https://cloudlinux.com/getting-start...configuration/ doesn't mention $ /usr/bin/switch_mod_lsapi --setup but https://cloudlinux.zendesk.com/hc/en...-cPanel-server which details installing via ssh (instead of?) EA4 says to run $ /usr/bin/switch_mod_lsapi --setup

                If I enabled mod_lsapi via Easy Apache 4, am I supposed to run either or both:
                # /usr/bin/switch_mod_lsapi --setup
                # /usr/bin/switch_mod_lsapi --enable-global​

                Comment

                • oceanwave
                  Member
                  Forum Explorer
                  • Dec 2024
                  • 33

                  #9
                  Sorry, corrected:
                  # rpm -q liblsapi
                  liblsapi-1.1-87.el9.cloudlinux.x86_64

                  Comment

                  • bogdan.sh
                    Administrator
                    • Nov 2016
                    • 1273

                    #10
                    There is no needs to run commands manually if you clicked button in WHM, I just checked test servers and I can select the lsapi from PHP Manager right after deployment:



                    Click image for larger version

Name:	Screenshot_20260113_133632.png
Views:	18
Size:	82.6 KB
ID:	40817

                    Where there any issues during the EasyApache provisioning? That's strange since the output you provided looks good. Could you please create a support ticket for us to check in place?

                    Comment

                    • oceanwave
                      Member
                      Forum Explorer
                      • Dec 2024
                      • 33

                      #11
                      Thanks,

                      There were no errors during the EasyApache provisioning.

                      In WHM I have the same options as your last screenshot; cgi, lsapi, or none. Each is set to cgi by default. For one alt-php version, this time 8.3, I set lsapi. No errors from the mutliphp manager when I set that.

                      The only indication that something isn't working correctly is that if I put a
                      Code:
                      <?php phpinfo(); ?>
                      file in the account running alt-php 8.3, it says Server API CGI/FastCGI whereas I'm expecting it to say Server API LightSpeed if it is actually running mod_lsapi.

                      Comment

                      • oceanwave
                        Member
                        Forum Explorer
                        • Dec 2024
                        • 33

                        #12
                        Also in the cloudlinux manager, what does domains 0 mean under lsapi if one of the alt-php versions is set to lsapi - should that show a number other than 0?
                        LSAPI mod version 1.1-87
                        LSAPI criu off
                        LSAPI with connection pool off
                        Criu status stopped
                        Total domains 0

                        Comment

                        • oceanwave
                          Member
                          Forum Explorer
                          • Dec 2024
                          • 33

                          #13
                          Searching a great deal, I see someone else had a similar issue several years ago. Is the following post from 2020 related:
                          Hay All I am trying to switch php 7.0 from suphp to lsapi. When in the WHM -> MultiPHP Manager Under Set PHP version per domain i set my test domain to "inherit", to use cloudlinux php selection Under PHP handlers 7.0 is set to use lsapi But when i do an phpinfo it shows Server api as "CGI/FastCGI" and i cant get it to switch over. What am i doing wrong? Thanks

                          Originally posted by egrechishkina
                          Hello Nigel,
                          You can do that with some sites only if they are not running PHP Selector. If the PHP version is selected in MultiPHP Manager and it is different from the system default. All users that use PHP Selector will be moved to the mandler that is selected for the system default version.
                          Is running php selector a problem here?

                          Is it important that the default php version in cloudlinux php selector be an ea-php version not an alt-php version? I believe the default in mutliphp manager has to be an ea- not an alt-version, but I'm not clear if there is any similar requirement for the default php version selection within cloudlinux php selector?

                          Or does lsapi have to be selected for the handler for the default php version in multiphp manager to work?
                          Or can the default be cgi (fastcgi) and only one or two alt-php versions set to lsapi?

                          Comment

                          • bogdan.sh
                            Administrator
                            • Nov 2016
                            • 1273

                            #14
                            There is no requirements for default PHP version or so, like on a screenshot above - you can have multiple handlers covering PHP and they would depend on PHP version only. If you select lsapi for PHP 8.4 only - the websites with php8.4 selected from their panel will use liblsapi, all the rest will do other (which is set default).

                            Can you please provide the screenshot of MultiPHP Manager and handlers selected in WHM (just like I did), and the screenshot of what is selected in user panel?

                            Comment

                            Working...