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.

SOLVED cPanel 60 and PHP-FPM activate on new creation

Discussion in 'EasyApache' started by sparek-3, Nov 25, 2016.

Tags:
  1. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,459
    Likes Received:
    35
    Trophy Points:
    178
    cPanel Access Level:
    Root Administrator
    Is the only way to enable PHP-FPM for a VirtualHost with cPanel 60 is to log into the WHM and use the MultiPHP Manager to activate PHP-FPM? Is there not a way to do this through the command-line? Am I missing something?

    Without being able to do this from the command-line, how can we do this on hookable events (such as new account creations) so that all VirtualHosts are PHP-FPM from the get-go?

    Previously, I had created an event to add PHP-FPM configuration and Apache Includes on account creation (I've been doing PHP-FPM per account instead of per VirtualHost, I note that cPanel 60 is doing this per VirtualHost, i.e. different pools for addons and subdomains). I can't figure out how to make this work with cPanel 60's PHP-FPM. Perhaps I'm missing something.
     
  2. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,459
    Likes Received:
    35
    Trophy Points:
    178
    cPanel Access Level:
    Root Administrator
    This is being discussed in the feature request section

    PHP-FPM enabled by default on account creation

    Seems that this isn't a high priority item. Not really sure why cPanel 60 is being lauded with Enhanced PHP-FPM support when it lacks this basic feature. But, no worries, I'll just keep using my old system for managing this.
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,425
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
  4. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,459
    Likes Received:
    35
    Trophy Points:
    178
    cPanel Access Level:
    Root Administrator
    What is vhost-0 suppose to be?

    Shouldn't this refer to whatever the ServerName is set to in httpd.conf?

    This doesn't appear to be the case for addon domains.

    If you have the main domain name animals.tld and you create an addon domain cats.tld - essentially what you are doing is creating a subdomain (cats.animals.tld) and parking (cats.tld) on top of this subdomain. Meaning that the ServerName is cats.animals.tld (cats.tld and www.cats.tld being ServerAlias's).

    However when you try to enable PHP-FPM for cats.animals.tld:

    Code:
    /usr/local/cpanel/bin/whmapi1 php_set_vhost_versions version=ea-php56 php_fpm=1 vhost-0=cats.animals.tld
    This results in an error

    Code:
    The system failed to apply the “PHP” version to “cats.animals.tld”: Cpanel::Exception::DomainNameNotAllowed/(XID feqbyv) The supplied domain name is invalid
    If you use cats.tld then this works

    Code:
    /usr/local/cpanel/bin/whmapi1 php_set_vhost_versions version=ea-php56 php_fpm=1 vhost-0=cats.tld
    I would caution to think about backwards compatibility here. Addon domains like this (at least as far as I know) have always been referenced from their subdomain counterpart.

    For example, if you want to include additional parameters for this VirtualHost in Apache, you have to create the directory /etc/apache2/conf.d/userdata/std/2_4/%user%/cats.animals.tld using cats.tld won't work.

    In fact the created PHP-FPM conf file is - /opt/cpanel/ea-php56/root/etc/php-fpm.d/cats.animals.tld.conf and the pool name is cats_animals_tld.

    Is this an oversight?

    While I can certainly appreciate the readability of vhost-0=cats.tld vs. vhost-0=cats.animals.tld I think you may run into backwards compatibility issues later on when you have to explain that addon domains are referenced as their addon domain name for PHP-FPM configuration, but referenced as their subdomain counterpart every where else.
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,425
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
  6. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,459
    Likes Received:
    35
    Trophy Points:
    178
    cPanel Access Level:
    Root Administrator
    OK. I can make this work this way. But I don't really agree with it. I think it's a slippery slope when you start mixing and matching one thing to mean one thing over here and to mean another thing over there.

    One of the issues I have with cPanel's development is that you sometimes seem to lack foresight into how things will be handled in the future. A feature or item might look good now, but then has to be changed two versions later because nobody in development thought of how it would actually be implemented.
     
Loading...

Share This Page