PHP:使用带有 mysqli_connect 的持久连接会导致损坏的管道错误
我正在运行:
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
可能是因为内存不足?您必须有许多持久连接,如何占用所有 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