#30254 [NEW]: MySQL Connection lost on ftp_close
| From: | mave at clanteamtreff dot com | Date: | Mon, 27 Sep 2004 10:51:39 +0000 |
| Subject: | #30254 [NEW]: MySQL Connection lost on ftp_close | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-66757@lists.php.net to get a copy of this message | ||
From: mave at clanteamtreff dot com
Operating system: Debian 3.0 r2 kernel 2.6.7
PHP version: 5.0.1
PHP Bug Type: FTP related
Bug description: MySQL Connection lost on ftp_close
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.
--
Edit bug report at http://bugs.php.net/?id=30254&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30254&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30254&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30254&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=30254&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=30254&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=30254&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=30254&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=30254&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=30254&r=support
Expected behavior: http://bugs.php.net/fix.php?id=30254&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=30254&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=30254&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=30254&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30254&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=30254&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=30254&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=30254&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=30254&r=float
MySQL Configuration Error: http://bugs.php.net/fix.php?id=30254&r=mysqlcfg