首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >用代码0退出的nginx php-fpm子程序

问用代码0退出的nginx php-fpm子程序
EN

Server Fault用户
提问于 2017-03-18 15:56:59
回答 2查看 25.3K关注 0票数 10

有谁在php 7与11.0版本p8有类似的问题,或者知道如何调试它?

情况在几分钟后开始,只向客户显示半页。任何页面都会显示出大约62 up的以��������� 4.结尾的内容

的日志文件:

代码语言:javascript
复制
[18-Mar-2017 15:41:49] NOTICE: [pool www] child 80582 exited with code 0 after 0.005648 seconds from start
[18-Mar-2017 15:41:49] NOTICE: [pool www] child 80584 started
[18-Mar-2017 15:41:49] NOTICE: [pool www] child 80583 exited with code 0 after 0.005877 seconds from start
[18-Mar-2017 15:41:49] NOTICE: [pool www] child 80585 started
[18-Mar-2017 15:41:49] NOTICE: [pool www] child 80581 exited with code 0 after 0.007763 seconds from start
[18-Mar-2017 15:41:49] NOTICE: [pool www] child 80586 started
[18-Mar-2017 15:41:49] NOTICE: [pool www] child 80585 exited with code 0 after 0.005653 seconds from start
[18-Mar-2017 15:41:49] NOTICE: [pool www] child 80587 started
[18-Mar-2017 15:41:49] NOTICE: [pool www] child 80586 exited with code 0 after 0.005820 seconds from start
[18-Mar-2017 15:41:49] NOTICE: [pool www] child 80588 started

PHP配置:

代码语言:javascript
复制
$php -v
PHP 7.0.17 (cli) (built: Mar 17 2017 02:07:44) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.0.17, Copyright (c) 1999-2017, by Zend Technologies

PHP-FPM.conf

代码语言:javascript
复制
pm = dynamic
pm.max_children = 25
pm.start_servers = 2
pm.min_spare_servers = 2
pm.max_spare_servers = 3
pm.max_requests = 0 ;changing to 500
EN

回答 2

Server Fault用户

回答已采纳

发布于 2017-05-06 11:15:06

当在代码中使用exec函数时,它是php错误。好的做法是阻止他们,这样他们就不会产生这样的问题。

https://bugs.php.net/bug.php?id=73342

臭虫已经开放了4年了。

票数 6
EN

Server Fault用户

发布于 2019-03-11 18:06:37

首先,这是预期的行为。这些消息被标记为“通知”,这是php-fpm.conf中的默认值:

代码语言:javascript
复制
; Log level
; Possible Values: alert, error, warning, notice, debug
; Default Value: notice
;log_level = notice

当您的php配置文件中定义了pm.max_requests选项时,进程就会退出和恢复。

例如:

代码语言:javascript
复制
; The number of requests each child process should execute before respawning.
; This can be useful to work around memory leaks in 3rd party libraries. For
; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
; Default Value: 0
pm.max_requests = 500

如果在本例中将其定义为500,则php在处理完500个请求后回收该流程。实际上,您可以忽略这些消息,因为它们是无害的,只是信息性的。

如果不希望记录这些消息,只需将日志级别更改为高于notice的级别,如warning。

票数 12
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/839135

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档