如何检查 php-fpm 是否安装并正确运行?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3091647/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 08:40:22  来源:igfitidea点击:

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

php

提问by Sean Xiong

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

如标题所示,如何检查 php-fpm 状态?它在运行吗?有多少请求服务?谢谢。

采纳答案by Gordon

You can get the SAPI with

您可以通过以下方式获取 SAPI

  • php_sapi_name— Returns the type of interface between web server and PHP
  • php_sapi_name— 返回 Web 服务器和 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.

以小写字符串形式返回接口类型。尽管并非详尽无遗,但可能的返回值包括 aolserver、apache、apache2filter、apache2handler、caudium、cgi(直到 PHP 5.3)、cgi-fcgi、cli、continuous、embed、isapi、litespeed、milter、nsapi、phttpd、pi3web、roxen、 thttpd、tux 和 webjames。

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

对于状态和服务的请求数量,您可能想要使用execsystem

回答by Gnarfoz

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

ps -ef | grep php-fpm太简单了第一部分的答案吗?

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

您还可以使用可以通过ping.path配置指令启用的 ping 功能。

The second part can be achieved with the pm.status_pathconfiguration directivethat gives you access to a number of statistics, including the number of accepted connections.

第二部分可以通过pm.status_path配置指令来实现,该指令使您可以访问许多统计信息,包括接受的连接数。