Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

htaccess and PHP versions questions

Discussion in 'EasyApache' started by jonnott, Aug 24, 2018.

  1. jonnott

    jonnott Registered

    Joined:
    Sep 8, 2014
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Reseller Owner
    Two issues that cause us big existential issues (!) regarding ea/cPanel..

    1. That suPHP seems to require a line in the web root's .htaccess file to point to the correct PHP executable. This causes problems with management of the .htaccess within, projects, problems with doing local dev elsewhere, and particularly with frameworks like Laravel, Symfony etc where the .htaccess file is basically there to route all requests via the front controller.
    Would like to know:
    - what's the reason this configuration cannot be elsewhere, i.e. not in the .htaccess file (some other per-site Apache config?)
    - if there's any roadmap or future likelihood of avoiding this line in .htaccess when using a suPHP version of PHP with ea.

    2. That a cPanel server cannot have the same PHP version running as both DSO and suPHP at the same time. This causes problems if you want to upgrade the server-wide DSO PHP version (e.g. from PHP 5.6 to 7.0), but don't want to affect sites that may already be using e.g. 7.0, but via suPHP instead.
    Would like to know:
    - what the technical reasons are why this situation exists
    - if there's any roadmap or future likelihood of being able to run the same PHP version via DSO and suPHP simultaneously

    Thanks!
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,714
    Likes Received:
    1,883
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello @jonnott,

    1. The entries in the .htaccess file make it possible for an individual cPanel user to change the version of PHP assigned to the account as part of the cPanel >> MultiPHP Manager feature and to ensure changes made through cPanel >> MultiPHP INI Editor are preserved if the handler changes in the future. You can read more about this at:

    MultiPHP INI Editor for cPanel - Version 74 Documentation - cPanel Documentation

    There are currently no plans to change this behavior going forward, but I encourage you to open a feature request if this is something you'd like to see modified:

    Submit A Feature Request

    2. In part it's because each PHP handler interacts with the Apache web server differently. For instance, suPHP is not compatible with the mpm_itk or the mod_ruid2 Apache module. You can read more about the each PHP handler at:

    PHP Handlers - EasyApache 4 - cPanel Documentation

    There are currently no plans to allow for the use of multiple PHP handlers on a single PHP version.

    Out of curiosity, is there any reason you prefer to use a handler such as DSO or suPHP instead of one like PHP-FPM?

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. jonnott

    jonnott Registered

    Joined:
    Sep 8, 2014
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Reseller Owner
    Would PHP-FPM help with either of these issues?
     
  4. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,714
    Likes Received:
    1,883
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello @jonnott,

    1. The following entry is still added to the .htaccess file when using PHP-FPM:

    Code:
    # php -- BEGIN cPanel-generated handler, do not edit
    # Set the “ea-php70” package as the default “PHP” programming language.
    <IfModule mime_module>
      AddType application/x-httpd-ea-php70 .php .php7 .phtml
    </IfModule>
    # php -- END cPanel-generated handler, do not edit
    
    This is how the PHP version is assigned to the account as part of the MultiPHP functionality, so I don't believe using PHP-FPM will help in that respect.

    2. PHP-FPM is a PHP handler, however it doesn't have to be the default handler assigned to the PHP version. For example, you can make suPHP the default PHP handler for PHP version 7.0 and then enable/disable PHP-FPM for domain names using PHP version 7.0 via WHM >> MultiPHP Manager. Thus, technically you can have two PHP handlers available at the same time on the same PHP version (as long as one of them is PHP-FPM).

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice