Announcement

Collapse
No announcement yet.

PHP selection change for account in CageFS appears to not take effect for that account

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • PHP selection change for account in CageFS appears to not take effect for that account

    LVE, PHP Selector

  • #2
    I am running a CloudLinux/cPanel server. The main PHP for the server is v5.6.17.

    I have one account on the server that needs to run PHP v5.2. I installed CageFS and when I run this command I see the user is accuratly within the CageFS group:

    Code:
     /usr/sbin/cagefsctl --list-enabled
    Then I go into the users cPanel and save "Current PHP version" as 5.2. All seems fine. But then I run a phpinfo() within the account and see it is still running 5.6.17. I also see the PHP that only works on 5.2 is not running inside this account, so it also shows the v5.2 is not "active" for this account.

    Did I miss a step in activating the PHP version change for this account? I also ran these commands, but they don;t seem to have helped:

    Code:
    /usr/sbin/cagefsctl --enable-all
    
    cagefsctl --force-update
    Thanks for your advice and tips~

    Comment


    • #3
      You still have to install PHP Selector!



      - Scott

      Comment


      • #4
        Hi, thanks for your help. Yes that was the very first thing I did And I just re-ran the commands and it says either the packages are already installed and there is nothing else to update. I also made just the Selector had all the versions inside the LVE.

        I there anything else I can do to troubleshoot and find the problem and solution? Thanks~

        Comment


        • #5
          Do you see 5.2 selected in users panel > Select PHP version ?
          What php version is shown when called from console? Try following:

          Code:
          su -l username -s /bin/bash
          
          php -v
          Do you use apache as web server? If yes, what php mode is used? Plase show the output of:

          Code:
          /usr/local/cpanel/bin/rebuild_phpconf --current

          Comment


          • #6
            Thanks for your help. In cPanel, when I login as that use rand then visit the "Select PHP Version" page I see:

            Current PHP version: 5.3

            And I also see a dropdown list of 4.4 to 7.0 with "native 5.6" at the bottom. But when I check the users own php version I get this result showing it is using the native v5.6:

            > root@websiteserver999 [~]# su -l MYUSERNAME -s /bin/bash
            > MYUSERNAME@websiteserver999 [~]# php -v
            > PHP 5.6.17 (cli) (built: Jan 22 2016 17:16:17)
            > Copyright (c) 1997-2015 The PHP Group
            > Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
            > with the ionCube PHP Loader v4.7.5, Copyright (c) 2002-2014, by ionCube Ltd.

            Here is the php mode info:

            > root@websiteserver999 [~]# /usr/local/cpanel/bin/rebuild_phpconf --current
            > Available handlers: suphp dso cgi none
            > DEFAULT PHP: 5
            > PHP4 SAPI: none
            > PHP5 SAPI: suphp
            > SUEXEC: enabled
            > RUID2: not installed

            Are there hints in there of a conflict or problem?

            Comment


            • #7
              So far from above information I can tell the following:
              PHP-Selector is installed and activated
              you are using right PHP mode in apache
              there were no errors entering cagefs

              However something is not Ok with actual switching procedure - php -v shows wrong version. Issue is not in apache, but somewhere in system.

              As of now please show:

              Code:
              sysctl -a | grep links
              But also from a user inside:

              Code:
              su -l username -s /bin/bash
              
              whoami
              
              ls -la /usr/local/bin/php
              
              ls -la /etc/cl.selector/php-cli

              Comment


              • #8
                Thanks for your help. Here are the outputs:

                Code:
                sysctl -a | grep links
                
                fs.protected_symlinks = 0
                
                fs.protected_hardlinks = 0
                
                fs.protected_symlinks_create = 0
                
                fs.protected_hardlinks_create = 0
                
                fs.protected_symlinks_allow_gid = 488
                
                fs.protected_hardlinks_allow_gid = 488
                
                fs.enforce_symlinksifowner = 1
                and this for the user:

                Code:
                USERNAME@website01 [~]# whoami
                
                USERNAME
                
                USERNAME@website01 [~]# ls -la /usr/local/bin/php
                
                -rwxr-xr-x 1 root root 30334986 Jan 22 17:16 /usr/local/bin/php*
                
                USERNAME@website01 [~]# ls -la /etc/cl.selector/php-cli
                
                lrwxrwxrwx 1 USERNAME USERNAME 26 Jan 24 14:21 /etc/cl.selector/php-cli -> /opt/alt/php53/usr/bin/php*

                Comment


                • #9
                  Ok, Im lost now .
                  Please create ticket at https://helpdesk.cloudlinux.com so we could check the issue in place.

                  Comment


                  • #10
                    Great thank you ticket just created: #ORH-585-65085

                    Comment


                    • #11
                      I have just checked this ticket and it appears suphp was compiled without LVE support. Things got fixed running /usr/sbin/cpanel-compile-suphp.sh .

                      However, how possible you have got wrong PHP version in this post??

                      > root@websiteserver999 [~]# su -l MYUSERNAME -s /bin/bash
                      > MYUSERNAME@websiteserver999 [~]# php -v
                      > PHP 5.6.17 (cli) (built: Jan 22 2016 17:16:17)

                      Comment


                      • #12
                        Yeah Im not sure either how that showed, but it was the same error we had on another server we installed with same configs last week. The solution to compile with support fixed both servers Pls mark this thread as solved

                        Comment


                        • #13
                          Hmmm... same problem. I just created a new account for a different site on this server. Then I went to the users cPanel and switch PHP to 5.2. It appeared to change in cPanel, but when i ran php -v I see the user is still running v5.6.17.

                          I will go ahead and re-run the patch like I did yesterday, but is that necessary? In the future each time I create a new account, should I tell the user to inform me when/if they chaneg PHP so I can run patches on the entire server? Thanks for your advice~

                          Comment


                          • #14
                            Definitely it should not work like that, I am going to reopen that ticket and investigate precisely.

                            Comment


                            • #15
                              Been doing more work the past few hours. It is working now, but strange. So when I run this for the user:

                              Code:
                              su -l username -s /bin/bash
                              
                              php -v
                              I get 5.6.17. But the actual PHP scripts inside that account that must use 5.2 are working fine.... so the accounts scripts now seem to be working fine, but Im still seeing 5.6.17 as the PHP running even though I know the script should not operate without lots of errors.

                              Comment

                              Working...
                              X