PHP:使用带有 mysqli_connect 的持久连接会导致损坏的管道错误

发布于 2024-10-01 06:11:03 字数 499 浏览 0 评论 0原文

我正在运行:

CentOS 5.5 x86
cPanels-11.26.20 RELEASE
Apache 2.2.16
PHP 5.3.3 "--with-mysqli=mysqlnd"
MySQL 5.1.51

当我连接到数据库时,我使用“p:localhost”作为主机名来建立持久连接。

昨天我在离开办公室之前使用我的应用程序没有任何问题。今天我再次尝试使用它,它返回了一个错误:

mysqli_connect() 发送 46 字节 失败,errno=32 管道损坏

如果我删除主机名前的“p:”,问题就解决了。再次在前面加上“p:”,错误再次出现。不过,重新启动 Apache 即可解决该问题,而无需编辑主机名。如果我在主机名中运行带有 p: 的 PHP CLI 脚本,它们可以正常工作,不会出现错误。

阿帕奇有问题吗?有谁知道这可能是什么原因造成的?

提前致谢。

I'm running:

CentOS 5.5 x86
cPanels-11.26.20 RELEASE
Apache 2.2.16
PHP 5.3.3 "--with-mysqli=mysqlnd"
MySQL 5.1.51

When I connect to the database, I use "p:localhost" for the hostname to establish a persistent connection.

Yesterday I was using my app no problem before leaving the office. Today I tried using it again and it returned an error:

mysqli_connect() send of 46 bytes
failed with errno=32 Broken pipe

If I remove the "p:" before the hostname, the issue is resolved. Prepend the "p:" again and the error reappears. However restarting Apache resolves the issue without the need to edit the hostname. If I run PHP CLI scripts w/ p: in the hostname, they work fine without an error.

Is there a problem with Apache? Does anyone know what could be causing this?

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

温暖的光 2024-10-08 06:11:03

可能是因为内存不足?您必须有许多持久连接,如何占用所有 RAM。
持久连接很晚才关闭,因此每次可能都会建立新连接

Probably is because of low memory? You had to many persistent connections how took all the RAM.
Persistent connections are closed very late so probably new connections are made each time

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文