Skip to main content

CloudLinux Knowledge Base

Different PHP versions per directories using mod_lsapi

Comments

8 comments

  • support

    Hi,

    i use this in .htaccess:

    <FilesMatch "\.(php4|php5|php3|php2|php|phtml)$">
    SetHandler application/x-httpd-ea-php74-lsphp
    </FilesMatch>

    But still dont work, i still see php5.6 from info.php page.

    I thinks that is related to your note:

    Note! There is one little trick that can be confusing. It applies only if you have PHP Selector enabled and you have a non-native version selected there for a user. In that case, if the version that you assign through .htaccess is the same as ea-php version selected as the system default version in WHM -> MultiPHP Manager -> System Default version, that version will not be applied, the version that you'll actually get will be the same as selected in PHP Selector.

    I will check and let you know about that,

    Please check.

    0
  • Bogdan Shyshka

    Hi,

    We would appreciate it if you create a thread on our community forum which is moderated and regularly checked by senior staff: https://forum.cloudlinux.com/forum/cloudlinux-os-features/hardened-php-and-php-selector

    We are interested in having this sorted, while the forum is a better place for conversation. Thanks!

    0
  • Tyler Hall

    The article probably needs updated as the handler that works for ALT-PHP needs to be set as:

    <FilesMatch "\.(php4|php5|php3|php2|php|phtml)$">
    SetHandler application/x-httpd-alt-php80___lsphp
    </FilesMatch>

    2
  • Bogdan Shyshka

    Thanks for the suggestion, it was applied.

    0
  • Nicolas Laruelle

    Do not forget to create the symlinks rules set to use "php selector".

    Source : 

    https://cloudlinux.zendesk.com/hc/en-us/articles/4411475922450-How-to-change-PHP-modules-when-using-different-PHP-versions-per-domain-

    Commands

    nano /etc/cl.selector/symlinks.rules

    Insert:

    php.d.location = selector

    /usr/bin/selectorctl --apply-symlinks-rules

     

    -1
  • Bogdan Shyshka

    There was a link to the documentation https://docs.cloudlinux.com/cloudlinux_os_components/#php-extensions , however the article you provided is more representative, so I changed it. Thank you.

    0
  • Richsystem

    Please check again, the sub domain was taking version 8.1.

    0
  • Bogdan Shyshka

    Please check again, the sub domain was taking version 8.1.

    Are we missing a part of history? Feel free to start a discussion on our forum

    0

Please sign in to leave a comment.