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.

Monitor Service - PHP-FPM service for Apache

Discussion in 'EasyApache' started by Nirjonadda, Apr 15, 2017.

Tags:
  1. Nirjonadda

    Nirjonadda Well-Known Member

    Joined:
    May 8, 2013
    Messages:
    557
    Likes Received:
    14
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    PHP-FPM service for Apache Down after Graceful Server Reboot.


    Code:
    Service Name     apache_php_fpm
    Service Status     failed ⛔
    Notification     The service “apache_php_fpm” appears to be down.
    Service Check Method     The system’s command to check or to restart this service failed.
    Number of Restart Attempts     6
    Service Check Raw Output     
    The subprocess “/usr/local/cpanel/scripts/restartsrv_apache_php_fpm” reported error number 9 when it ended.
    Startup Log     No startup log
    Memory Information     
    Used     5.75 GB
    Available     5.82 GB
    Installed     11.58 GB
    Load Information     0.50 0.67 1.02
    Uptime     35 minutes and 15 seconds
     
    #1 Nirjonadda, Apr 15, 2017
    Last edited: Apr 15, 2017
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    42,734
    Likes Received:
    1,706
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    It's possible the service check ran before the system could fully start the services after the reboot. Could you verify if the service resumed after waiting a few minutes after the reboot?

    Thank you.
     
  3. Nirjonadda

    Nirjonadda Well-Known Member

    Joined:
    May 8, 2013
    Messages:
    557
    Likes Received:
    14
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Please let me know that how to check ?
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    42,734
    Likes Received:
    1,706
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    You can browse to "WHM >> Service Status" to confirm that "apache_php_fpm" shows as "UP".

    Thank you.
     
  5. Nirjonadda

    Nirjonadda Well-Known Member

    Joined:
    May 8, 2013
    Messages:
    557
    Likes Received:
    14
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Yes Its is down stage.

    Screenshot_13.png
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    42,734
    Likes Received:
    1,706
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Could you let us know the output when attempting to restart the service? EX:

    Code:
    /scripts/restartsrv_apache_php_fpm
    Thank you.
     
  7. Nirjonadda

    Nirjonadda Well-Known Member

    Joined:
    May 8, 2013
    Messages:
    557
    Likes Received:
    14
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Code:
    [root@na ~]# /scripts/restartsrv_apache_php_fpm
    Service Status
    
    apache_php_fpm restarted successfully.
    [root@na ~]#
    Still are down from Service Status.
     
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    42,734
    Likes Received:
    1,706
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Could you open a support ticket using the link in my signature so we can take a closer look? You can post the ticket number here so we can update this thread with the outcome.

    Thank you.
     
  9. Nirjonadda

    Nirjonadda Well-Known Member

    Joined:
    May 8, 2013
    Messages:
    557
    Likes Received:
    14
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Support Request ID is: 8387389
     
  10. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    42,734
    Likes Received:
    1,706
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    To update, it looks like this issue stemmed from a rogue configuration file located at:

    Code:
    /opt/cpanel/ea-php71/root/etc/php-fpm.d/www.conf
    Moving this file out of the way and restarting the Apache PHP-FPM service corrected the issue.

    Thank you.
     
  11. kudotcom

    kudotcom Registered

    Joined:
    Jun 16, 2017
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Near a keyboard
    cPanel Access Level:
    Root Administrator
    Do you mind saying what kind of setting it was? I'm having the same issue, the service is up though and wondering if it is some kind of issue from the example configruation.

    That's the only I got from log files:

    [16-Jun-2017 16:52:58.067518] DEBUG: pid 194089, fpm_got_signal(), line 85: received SIGTERM
    [16-Jun-2017 16:52:58.067545] NOTICE: pid 194089, fpm_got_signal(), line 86: Terminating ...
    [16-Jun-2017 16:52:58.067553] DEBUG: pid 194089, fpm_pctl(), line 231: switching to 'terminating' state
     
  12. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    42,734
    Likes Received:
    1,706
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    It was the existence of the "www.conf" file itself, as that file is not utilized or populated through cPanel's PHP-FPM implementation. Configuration files in the "/opt/cpanel/ea-php$$/root/etc/php-fpm.d/" directories are named with the domain name (e.g. example.tld.conf). Here's an example of a default configuration file for a domain name:

    Code:
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ; cPanel FPM Configuration ;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    
    ; NOTICE This file is generated, please use our WHM User Interface
    ; to set these value.
    
    [example_com]
    catch_workers_output = yes
    chdir = /home/example
    group = example
    listen = /opt/cpanel/ea-php56/root/usr/var/run/php-fpm/ac93c83b7b5fb1234599d41e0e7e56f03150691.sock
    listen.group = nobody
    listen.mode = 0660
    listen.owner = example
    php_admin_flag[allow_url_fopen] = on
    php_admin_flag[log_errors] = on
    php_admin_value[disable_functions] = exec,passthru,shell_exec,system
    php_admin_value[doc_root] = "/home/example/public_html"
    php_admin_value[error_log] = /home/example/logs/example_com.php.error.log
    php_admin_value[short_open_tag] = on
    php_value[error_reporting] = E_ALL & ~E_NOTICE
    ping.path = /ping
    pm = ondemand
    pm.max_children = 5
    pm.max_requests = 20
    pm.max_spare_servers = 5
    pm.min_spare_servers = 1
    pm.process_idle_timeout = 10
    pm.start_servers = 0
    pm.status_path = /status
    security.limit_extensions = .phtml .php .php3 .php4 .php5 .php6 .php7
    user = example
    Thank you.
     
  13. uk01

    uk01 Well-Known Member

    Joined:
    Dec 31, 2009
    Messages:
    82
    Likes Received:
    7
    Trophy Points:
    58
    For anyone else who reads this thread after experiencing php FPM down, I discovered another issue with the same folder.

    If you modify an account domain, the conf file for that domain gets left in the folder
    /opt/cpanel/ea-php56/root/etc/php-fpm.d/www.conf
    or /opt/cpanel/ea-php70/root/etc/php-fpm.d/www.conf
    or /opt/cpanel/ea-php71/root/etc/php-fpm.d/www.conf
    or /opt/cpanel/ea-php72/root/etc/php-fpm.d/www.conf

    If you remove it, PHP-FPM runs again and sites come back up, but under PHPManager in WHM it will show an API failure, I'm currently looking into a way to resolve that.

    (Edited to clarify that sites come back up after removing files)
     
    #13 uk01, Mar 2, 2018
    Last edited: Mar 2, 2018
  14. uk01

    uk01 Well-Known Member

    Joined:
    Dec 31, 2009
    Messages:
    82
    Likes Received:
    7
    Trophy Points:
    58
    Ok in order to resolve the API error in WHM, I had to add the original domain back to the server, + the sub domains which were on the account.
    It seemed to be the sub domain missing which caused an API error in the Multiphp manager part of WHM.
    Adding it back in created the file again in the folders in my previous post.

    Note to Cpanel to look into this as part of the script to modify an account domain, looks like it misses something
     
    #14 uk01, Mar 2, 2018
    Last edited: Mar 2, 2018
  15. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    42,734
    Likes Received:
    1,706
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hi @uk01,

    The following internal case should address the issue you noticed (note that addon domain names are technically setup as subdomains):

    CPANEL-16727 - Changing the main domain of an account with FPM enabled subdomains results in an error message when accessing "WHM >> MultiPHP Manager".

    I'll monitor this case and update this thread with more information on it's status as it becomes available.

    Thank you.
     
Loading...

Share This Page