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!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PHP handler for PHP-FPM

Discussion in 'General Discussion' started by celiac101, Mar 13, 2018.

Tags:
  1. celiac101

    celiac101 Well-Known Member

    Joined:
    Dec 19, 2012
    Messages:
    59
    Likes Received:
    1
    Trophy Points:
    6
    cPanel Access Level:
    Website Owner
    Last night I turned on PHP-FPM on my sites that run PHP 7. I was using SUPHP. I did this in
    Home »Software »MultiPHP Manager
    and all seems to be fine.

    However, I see that my PHP handler for PHP 7 is still set to SUPHP, so maybe I haven't made the switch yet? What should my PHP handler be for PHP-FPM--my choices are CGI, None or suPHP (I run memcached as well)?

    Also, when I go to change the handler I get a warning:
    "Changes to this “PHP” version’s handler may cause errors for the domains that use it."
    Is it ok to change this on a very busy live site with lots of php stuff going on?
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,245
    Likes Received:
    1,759
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    PHP Handlers do not apply to PHP-FPM. Once you enable PHP-FPM for an account, that becomes it's handler and thus the default PHP handler you enable for a version of PHP no longer applies to that account.

    If you've enabled PHP-FPM for all accounts, then it doesn't matter what you configure as the PHP handler for a version of PHP, because the accounts will instead use PHP-FPM (no matter what's configured as the handler).

    Thank you.
     
  3. celiac101

    celiac101 Well-Known Member

    Joined:
    Dec 19, 2012
    Messages:
    59
    Likes Received:
    1
    Trophy Points:
    6
    cPanel Access Level:
    Website Owner
    Thank you for that explination. So now my problem is that I have some applications that are in separate directories that need to run on PHP 5.6, instead of PHP 7. Before I used the code below in an .htaccess file to make that directory use PHP 5.6. Is there any way to do this now that I am on PHP-FPM ?

    # php -- BEGIN cPanel-generated handler, do not edit
    # Set the “ea-php56” package as the default “PHP” programming language.
    <IfModule mime_module>
    AddType application/x-httpd-ea-php56 .php .php5 .phtml
    </IfModule>
    # php -- END cPanel-generated handler, do not edit
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,245
    Likes Received:
    1,759
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    PHP-FPM is controlled through the Apache virtual host, so while it's possible to enable a different PHP version on a addon domain or subdomain, it's not configurable on a per-directory basis. You'd need to create a subdomain for that directory and access it via the subdomain in the address bar of your browser if that's the behavior you are seeking and you want to continue using PHP-FPM.

    Thank you.
     
  5. celiac101

    celiac101 Well-Known Member

    Joined:
    Dec 19, 2012
    Messages:
    59
    Likes Received:
    1
    Trophy Points:
    6
    cPanel Access Level:
    Website Owner
    Would you happen to have an example of the code required in the Apache virtual host to make a virtual directory keep using PHP 5.6? For example, I have one folder that is in a subdomain without www, so it uses domain123.com instead of www.domain123.com. The example directory name off root is /advertising

    Please let me know.
     
    #5 celiac101, Mar 13, 2018
    Last edited: Mar 13, 2018
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,245
    Likes Received:
    1,759
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    We currently only support updating the PHP version on a per-domain or per-subdomain basis when PHP-FPM is enabled. You'd need to setup a separate subdomain for each application that requires it's own PHP version and assign it that specific version using the MultiPHP Manager option in cPanel or WHM.

    Thank you.
     
Loading...

Share This Page