简体   繁体   中英

PHP: Using persistent connections with mysqli_connect results in Broken Pipe errors

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM