【发布时间】:2018-01-02 03:40:47
【问题描述】:
我正在使用 Apache 2.4.23 - MySQL 5.7.14 运行 Wamp 服务器 3.0.6 64 位
当我使用 PHP 5.6.25 时一切正常,我没有问题。
但是当我使用 PHP 7.0.10 时,当我对应用程序施加一点压力时,Apache 日志上会出现以下错误(同时运行多个 PHP 请求并通过 PDO 连接请求 mysql 数据库)
[Wed Jul 26 18:55:25.459433 2017] [mpm_winnt:notice] [pid 11352:tid 616] AH00428: Parent: child process 5560 exited with status 255 -- Restarting.
[Wed Jul 26 18:55:25.613195 2017] [auth_digest:notice] [pid 11352:tid 616] AH01757: generating secret for digest authentication ...
[Wed Jul 26 18:55:25.703752 2017] [mpm_winnt:notice] [pid 11352:tid 616] AH00455: Apache/2.4.23 (Win64) PHP/7.0.10 configured -- resuming normal operations
[Wed Jul 26 18:55:25.703752 2017] [mpm_winnt:notice] [pid 11352:tid 616] AH00456: Apache Lounge VC14 Server built: Jul 1 2016 11:43:51
[Wed Jul 26 18:55:25.703752 2017] [core:notice] [pid 11352:tid 616] AH00094: Command line: 'c:\\wamp64\\bin\\apache\\apache2.4.23\\bin\\httpd.exe -d C:/wamp64/bin/apache/apache2.4.23'
[Wed Jul 26 18:55:25.703752 2017] [mpm_winnt:notice] [pid 11352:tid 616] AH00418: Parent: Created child process 12680
[Wed Jul 26 18:55:27.304382 2017] [auth_digest:notice] [pid 12680:tid 648] AH01757: generating secret for digest authentication ...
[Wed Jul 26 18:55:27.324432 2017] [mpm_winnt:notice] [pid 12680:tid 648] AH00354: Child: Starting 64 worker threads.
我在 stackoverflow 上看到了一些类似错误的帖子,但没有答案解决我的问题,也没有提到会导致该错误的 PHP 版本。
有人遇到/解决过这个问题吗?
谢谢!
【问题讨论】:
-
看起来您超出了
MaxConnectionsPerChild的值。当子进程超过MaxConnectionsPerChild值时,退出进程中的活动请求在处理中止之前有 TimeOut 秒完成。更多详情MPM Apache module -
问题是它在 PHP 5.6.25 中运行良好,但在 PHP 7.0.10 中却不行。此外,在我的测试中,我只有 10 个连接
-
试试这个解决方案。 stackoverflow.com/a/49487367/9540128 在类似案例中为我提供帮助。