php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39239 pconnect can?t reuse open connection
Submitted: 2006-10-23 15:30 UTC Modified: 2006-10-23 17:53 UTC
From: marcos dot neves at gmail dot com Assigned:
Status: Not a bug Package: MySQL related
PHP Version: 5.1.6 OS: FreeBSD 5.4-STABLE i386
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: marcos dot neves at gmail dot com
New email:
PHP Version: OS:

 

 [2006-10-23 15:30 UTC] marcos dot neves at gmail dot com
Description:
------------
Probably it?s the same bug of 38283, but with a newer version and a different OS.

I try the same version on windows, and mysql_pconnect reuse the connection as expected. But on two php instalations on two machines, pconnect works as a simple mysql_connect.
The php.ini configuration are ok, and php is running as Apache Module, as required for pconnect works.

FreeBSD 5.4-STABLE i386

apache-2.2.2_1 Version 2.2 of Apache web server with prefork MPM.

php5-5.1.6_2


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-10-23 15:38 UTC] tony2001@php.net
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.



 [2006-10-23 15:46 UTC] marcos dot neves at gmail dot com
<?
mysql_pconnect(...); // just open a connection
?>

RUN the follow command on a mysql client:
SHOW PROCESSLIST

Since it?s persistent, that connection will be listed on PROCESSLIST. If you run the script again, the same opened connection should be used in place, and the timeout would be reset to zero. The problem is that a new connection has been opened.

Please, tell me what more information can I give, cause the bug happens only under my server.
 [2006-10-23 15:57 UTC] tony2001@php.net
>If you run the script again, the same opened connection
>should be used in place, and the timeout would be reset 
>to zero.
Only if your next request is server by THE VERY SAME Apache child as the previous one, 'cause persistent resources are per-process/per-thread.
 [2006-10-23 17:53 UTC] marcos dot neves at gmail dot com
How can I configure Apache to reuse the same thread more as it can. Cause each request, it?s creating a new connection with the database. Could it be because I?m using Apache with prefork MPM?
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 00:01:28 2024 UTC