Skip to main content

How to check apache_php_fpm status

Comments

6 comments

  • durangod

    I know in cpanel if you click server information on the right sidebar all the status values are there if you scroll down.   In WHM its under server status -> service status   There is also an apache status

    not sure with command line, sorry 

    I did find this 

    https://statuslist.app/uptime-monitoring/guides/php-fpm-status-page/#:~:text=Open%20http%3A%2F%2F127.0.0.1,%2Dfpm%2Fstatus%3Fjson.

    0
  • cPRex Jurassic Moderator

    Is there something specific you're looking for?  There isn't a "status" page like what "apachectl status" will show for PHP-FPM on the server.

    0
  • kgs

    Hey cPRex What I meant was, when I run "service mysqld status" in Terminal I get

    Redirecting to /bin/systemctl status mysqld.service
    ● mysqld.service - MySQL Server
       Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
      Drop-In: /etc/systemd/system/mysqld.service.d
               └─limits.conf
       Active: active (running) since Sat 2024-08-17 19:11:34 PDT; 1 day 19h ago
         Docs: man:mysqld(8)
               http://dev.mysql.com/doc/refman/en/using-systemd.html
      Process: 541 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
     Main PID: 581 (mysqld)
       Status: "Server is operational"
       CGroup: /system.slice/mysqld.service
               └─581 /usr/sbin/mysqld

    And when I run "service apache_php_fpm status" I get a similar output, but it says "inactive (dead)" (see initial post) though it's clearly running, since all my PHP-FPM sites are up, and I'm not getting email notices from WHM that it's down. (When it does supposedly go down and then get restored, I get email notifications.)

    So I was just looking for the quickest way to verify that it's actually up. Thanks!

    0
  • cPRex Jurassic Moderator

    I didn't know the answer to this one either, so I reached out to one of our developers.  The short version is that systemd doesn't manage the PHP-FPM processes, so it doesn't have a way to show a valid status. There is a note about this inside the service file:

    # systemctl cat apache_php_fpm | head -4
    # /etc/systemd/system/apache_php_fpm.service
    #
    # This systemd unit is a placeholder and should not be enabled nor used for
    # management of Apache PHP-FPM processes.

    The best thing to do is just check processes with good ol' "ps aux" and see if things are running as they should.

    0
  • kgs

    Thanks. I just figured out I can use

    systemctl list-units --type=service --state=running

    That shows me

    ea-php74-php-fpm.service            loaded active running The PHP FastCGI Process Manager
    ea-php81-php-fpm.service            loaded active running The PHP FastCGI Process Manager

    So that should work!

    Thanks!

    0
  • cPRex Jurassic Moderator

    That works too!

    0

Please sign in to leave a comment.