Sean Xiong
Sean Xiong

Reputation: 125

How to check if php-fpm is installed and running correctly?

As in title, how to check php-fpm status? Is it running? How many request serving? Thanks.

Upvotes: 9

Views: 26988

Answers (2)

Gordon
Gordon

Reputation: 317119

You can get the SAPI with

  • php_sapi_name — Returns the type of interface between web server and PHP

Returns the interface type, as a lowercase string. Although not exhaustive, the possible return values include aolserver, apache, apache2filter, apache2handler, caudium, cgi (until PHP 5.3), cgi-fcgi, cli, continuity, embed, isapi, litespeed, milter, nsapi, phttpd, pi3web, roxen, thttpd, tux, and webjames.

For status and how many requests are served you might want to use exec or system.

Upvotes: 6

Gnarfoz
Gnarfoz

Reputation: 3236

Is ps -ef | grep php-fpm too simple an answer for the first part?

You could also use the ping feature that you can enable with the ping.path configuration directive.

The second part can be achieved with the pm.status_path configuration directive that gives you access to a number of statistics, including the number of accepted connections.

Upvotes: 8

Related Questions