|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-10-02 14:58 UTC] mave at clanteamtreff dot com
[2005-02-12 22:45 UTC] tony2001@php.net
[2005-02-20 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 12:00:01 2025 UTC |
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.