Announcement

Collapse
No announcement yet.

My "PHP version per directory" config not working anymore after todays alt-php update

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

  • My "PHP version per directory" config not working anymore after todays alt-php update

    Hello,
    after todays php selector/alt-php upd ate my custom "php version per directory" config is not working anymore.
    As I can see, you removed php.d symlink to /etc/cl.php.d/alt-phpXX and now you replaced it with regular php.d directory containing default.ini file in it.
    So now for example if I place line in .htaccess:
    AddType application/x-httpd-php70 .php
    my php version is switched to 7.0.4 in my directory but modules configured in cPanel PHP Selector are not configured anymore and not visible in phpinfo();.
    Instead of php.d symlink to /etc/cl.php.d/alt-phpXX you created link directory with cons symlink in it pointing to /opt/alt/phpXX/etc/php.d instead of pointing to /etc/cl.php.d/alt-phpXX like before, which breaks my custom php version se t per directory basis.

    It was your intended action or you did this by mistake or any other reason?

    FYI I have LiteSpeed Web Server with CageFS and as a Command config value in lsws for PHP 7 for example Im using:
    /opt/alt/php70/usr/bin/lsphp

    and this way me and my customers was able to switch PHP versions per directory basis since many months up until today.

  • #2
    UPDATE:
    As per suggestion in the ticket I removed php.d directories and changed them to php.d symlinks pointing to /etc/cl.php.d/alt-phpXXdirectories.
    Now everything is working like before but only until next alt-php/selector upgrade. Can you do this permanent for users not using EaseApache and MultiPHP functionality? or I will have to manually do this every time after alt-php update?

    Comment


    • #3
      Same problem here, is this a bug ? Do you have a more reliable / long term solution to solve this issue ?

      Comment


      • #4
        I have just talked to our developers and unfortunately there is no
        ice solution for this as PHP per directory is not officially supported by CloudLinux .

        The solution to remove php.d and made symlinks is right, and yes the same should be done after next alt-php update.

        Comment


        • #5
          We are considering this situation right now to provide a right and working solution for you. I will update this thread.

          Comment


          • #6
            We decided to cover all possible situations and in future going to implement following functionality - there will be a config option where you choose how those symlinks will be created:
            - default, where users will get same default modules for enabled and disabled CageFS. So alt-php could be used without cagefs and without PHP-Selector.
            or
            - custom, where you will get modules chosen from PHP-Selector for PHP versions when CageFS enabled. However with disabled CageFS you will get default extensions.

            After implementing PHP version per directory you will set th way alt-php handle symlinks for example in /etc/cl.selector/symlinks.rules file .This way PHP per directory will keep working after updates, etc.

            Let me know what you think about this.

            Comment


            • #7
              Were happy to go with:
              default, where users will get same default modules for enabled and disabled CageFS. So alt-php could be used without cagefs and without PHP-Selector

              Comment


              • #8
                That is how it works now... Thats why it breaks php per directory.
                Going to make it selectable so it will work properly for standard and for php per directories also.

                Comment


                • #9
                  Sounds good

                  Comment


                  • #10
                    Same problem here. Is this script correct way to fix the original state?

                    Code:
                    #!/bin/bash
                    
                    for VERSION in `ls /opt/alt|grep "php[0-9]"`
                    
                    do
                    
                    if [ -d "/opt/alt/$VERSION/etc/php.d" ]; then
                    
                    rm -rf "/opt/alt/$VERSION/etc/php.d"
                    
                    ln - "/opt/alt/$VERSION/etc/php.d" "/etc/cl.php.d/alt-$VERSION"
                    
                    echo "$VERSION - OK"
                    
                    fi
                    
                    done

                    Comment

                    Working...
                    X