php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1247 mysql_pconnect() makes new connection every time
Submitted: 1999-03-19 10:41 UTC Modified: 1999-03-19 15:30 UTC
From: glitter at chollian dot net Assigned:
Status: Closed Package: MySQL related
PHP Version: 3.0.7 OS: Solaris7 x86
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: glitter at chollian dot net
New email:
PHP Version: OS:

 

 [1999-03-19 10:41 UTC] glitter at chollian dot net
Specification:
Solaris7 x86 Pentium II 400Mhz with 128MB Main Memory
Apache WebServer 1.3.4
MySQL 3.22.19a
PHP-3.0.7

I found a problem on using mysql_pconnect().
It doesn't do described on manual.
When I try to connect my web page, it establishes new connection to MySQL every time.
So, If I try 30 times, there are 30 thread processes on 'mysqladmin processlist'.
Every process were slept, of course.

But, in the manual of mysql_pconnect(),
----
First, when connecting, the function would first try to find a (persistent) link that's already open with the same host, username and password. If one is found, an identifier for it will be returned instead of opening a new connection. 
----

I specified username and password in constant type. Then, how this can happen?
Please let me know asap.

MinSoon Park

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-03-19 15:30 UTC] sas
PHP3 tries to find such a connection on a per process base. A ps ax|grep httpd| wc -l will show you that there are at least the same number of Apache processes running.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jun 03 09:01:26 2025 UTC