php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30254 MySQL Connection lost on Socket Close
Submitted: 2004-09-27 12:51 UTC Modified: 2005-02-20 01:00 UTC
Votes:3
Avg. Score:3.7 ± 0.9
Reproduced:1 of 2 (50.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: mave at clanteamtreff dot com Assigned:
Status: No Feedback Package: MySQL related
PHP Version: 5.0.1 OS: Debian 3.0 r2 kernel 2.6.7
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: mave at clanteamtreff dot com
New email:
PHP Version: OS:

 

 [2004-09-27 12:51 UTC] mave at clanteamtreff dot com
Description:
------------
currently i use a MySQL Class to handle the Connection to the Database. No i wrote a litte FTP tool, to get a logfile from an other server.

After the command ftp_close my MySQL Connection is broken, he tells me, MySQL Connection lost during Query or Connection to MySQL lost, reconnecting.

If i deactivate the ftp_close command, the whole page runns perfectly. I think there is a problem with handling the resources.

I use the XAMPP Linux 1.4.8 from www.apachefriends.org.

Reproduce code:
---------------
$handle = ftp_connect(gethostbyname("localhost"), 21);
$res = ftp_login( $handle, $login, $pass);
if( !$res ) echo "Can't login to FTP";

$f_name = "/tmp/FTP-TMP.".randomstring(20);

$file = fopen( $f_name, "w+" );
if( !$file ) echo "Can't fopen the File";

ftp_fget( $handle, $file, "lastout.txt", FTP_ASCII);

... 
$kontent = writemessage($out);  // Produce the output

fclose($file);
ftp_close($handle);		// clean up
unlink($f_name);		// clean up


Expected result:
----------------
Output from the MySQL Class:
[MySQL]: Verbindung zum Host verloren, neuaufbau der Verbindung
(that means connection lost, reconnecting)

And the rest of the Page can't connect to the mysql server.

after i remove the "ftp_close($handle);" line, it works fine.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-10-02 14:58 UTC] mave at clanteamtreff dot com
im currently develope some new interfaces, the problem i told with problems on ftp_close() can reproduced with all socket connections. 
This mean, my SQL Connection gets lost if any command closes a socket connection.

I connect to sql server ( mysql_connect(...) )
then i want to use file_get_contents with fopen wrappers from an ftpserver. 
The File read from the ftp server is sucessfully, but after that command, the mysql connection is lost.

All the Commands i have testet with using sockets or something like this, kills the mysql connection.

If there are any questitions, just ask.
(Sorry for my bad english, i hope you understand all)
 [2005-02-12 22:45 UTC] tony2001@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.0-win32-latest.zip

Please provide a short but complete reproduce script if you still expirience this issue.
 [2005-02-20 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jan 23 21:01:28 2025 UTC