NYCPHP Meetup

NYPHP.org

[nycphp-talk] mysql_pconnect problems with PHP 4.3.0 anyone?

Hans Zaunere zaunere at yahoo.com
Fri Jan 24 10:56:07 EST 2003


--- George Webb <gw.nyphp at gwprogramming.com> wrote:
> Hi NYPHPeeps... I am jealous to be out of the area during the LWE...
> I hope you are loving it.
> 
> 	Has anyone noticed any occasional failures with mysql_pconnect()
> failing to reconnect using PHP version 4.3.0?  I would assume the
> desired operation would be for PHP to silently reconnect any persistent
> connection which seems to have died.  However the following fatal error
> (it's hardly a "warning!") occurs somewhat frequently now, with PHP
> 4.3.0 (Apache module sapi) and MySQL 3.23.54 on RH Linux 7.1/Apache 1.3.27.
> Also, the MySQL server is on a remote machine, so mysql_pconnect() is using
> TCP/IP.

What's the fatal error?  Is it something like what's at:

http://bugs.php.net/bug.php?id=21498

> 	I suppose that dropped connections is not the problem;
> rather, the problem is that mysql_pconnect() fails to *reconnect*.
> 
> 	Of course I don't see why the connection would have dropped;
> the server was not restarted and there are no networking failures.

Sometimes it's a timeout issue.  Take a look at the user comments at
http://www.php.net/manual/en/function.mysql-pconnect.php

> 	If I can't figure it out, I guess we'll go back to using
> mysql_connect(), wouldn't you agree?  Has anyone else noticed anything 
> similar?  The PHP.net manual entry for mysql_pconnect() 
> ( http://www.php.net/manual/en/function.mysql-pconnect.php )
> shows a user comment suggesting that 4.3.0 might be the problem.

Oh, you already did look at the user comments  :)  I've had pconnects working
in production for over a year with  no problems, albeit 4.0.6 for the most
part.  However, I have heard a slight buzz about problems with 4.3.0's
pconnect, although I can't say what they are.  Unless you have very high
traffic, I'd go with mysql_connect() anyway.

Hans


> 
> 	Below is the phpinfo() mysql section.  Thanks for your thoughts.
> 
> ----
> mysql
> 
> MySQL Support => enabled
> Active Persistent Links => 1
> Active Links => 1
> Client API version => 3.23.54
> MYSQL_MODULE_TYPE => external
> MYSQL_SOCKET => /tmp/mysql.sock
> MYSQL_INCLUDE => -I/usr/local/mysql/include
> MYSQL_LIBS => -L/usr/local/mysql/lib -lmysqlclient
> 
> Directive => Local Value => Master Value
> mysql.allow_persistent => On => On
> mysql.connect_timeout => -1 => -1
> mysql.default_host => no value => no value
> mysql.default_password => no value => no value
> mysql.default_port => no value => no value
> mysql.default_socket => /tmp/mysql.sock => /tmp/mysql.sock
> mysql.default_user => no value => no value
> mysql.max_links => Unlimited => Unlimited
> mysql.max_persistent => Unlimited => Unlimited
> mysql.trace_mode => Off => Off
> ----
> 
> 
> Best, George.
> 
> George Webb
> gw.nyphp at gwprogramming.com
> 
> 
> --- Unsubscribe at http://nyphp.org/list/ ---
> 
> 


=====
Hans Zaunere
President, New York PHP
http://nyphp.org
hans at nyphp.org



More information about the talk mailing list