php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #9572 mysql_connect() with timeout
Submitted: 2001-03-06 01:20 UTC Modified: 2002-07-16 10:53 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: php at winux dot com Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 4.0.4pl1 OS: all
Private report: No CVE-ID: None
 [2001-03-06 01:20 UTC] php at winux dot com
A few months ago I modified PHP 3.0.16 to add an optional fourth
parameter to the mysql_connect() functions.  The parameter specifies
a timeout (in seconds) on the connect().  The patch simply uses the
existing mysql_options() function in the MySQL library so it's
quite stable code.

I'm in the process of upgrading to PHP 4.0.4pl1 and so I've made
a comparable change to that code base.

Here are the patches for each version:

http://www.winux.com/php/connection_timeout_php-3.0.16.txt
http://www.winux.com/php/connection_timeout_php-4.0.4pl1.txt

Since the timeout parameter is optional, the change is completely upward
compatible with the existing languages.  It's a wonderful thing.

Is there any chance either of these might make it into the official release?

Larry

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-07-16 10:53 UTC] georg@php.net
To use the mysql_options connect_timeout parameter set the 
value mysql.connect_timeout in your php.ini file. Its 
supported since PHP 4.3.0 (current cvs tree).


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 07 09:01:31 2024 UTC