Bug #13868 Updated: Unable to find ftpbuf 1 in ....

From: Date: Wed, 31 Oct 2001 11:16:19 +0000
Subject: Bug #13868 Updated: Unable to find ftpbuf 1 in ....
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-69408@lists.php.net to get a copy of this message
ID: 13868 User updated by: j.parree@net-communications.de Reported By: j.parree@net-communications.de Status: Open Bug Type: FTP related Operating System: Suse 7.1 - oldwotan 2.4.3 #1 PHP Version: 4.0.4pl1 New Comment: A working example: This example should download an html-file. <? class ftpimport{ function GetViaFTP(){ $FTPDataHost = "212.227.140.167"; $FTPDataUser = "anonymous"; $FTPDataPass = "asd@test.de"; $docName = "index.html"; $ftpConn = ftp_connect($FTPDataHost); $ftpLogin = ftp_login($ftpConn, $FTPDataUser, $FTPDataPass); if($ftpConn && $ftpLogin){ $fp = fopen($docName, "w"); echo "ftp conn : " . $ftpConn . "<br>"; if(!ftp_fget($ftpLogin, $fp, trim($docName), FTP_BINARY)) echo "error"; fclose($fp); } ftp_quit($ftpLogin); } } $newImport1 = new ftpimport; // this works $newImport1->GetViaFTP(); // this works $newImport2 = new ftpimport; // this causes the problem $newImport2->GetViaFTP(); // this causes the problem ?> A solution would be: $ftpLogin = ftp_login(ftp_connect($FTPDataHost), $FTPDataUser, $FTPDataPass); Instead of: $ftpConn = ftp_connect($FTPDataHost); $ftpLogin = ftp_login($ftpConn, $FTPDataUser, $FTPDataPass); Previous Comments: ------------------------------------------------------------------------ [2001-10-31 06:15:39] j.parree@net-communications.de A working example: This example should download an html-file. <? class ftpimport{ function GetViaFTP(){ $FTPDataHost = "212.227.140.167"; $FTPDataUser = "anonymous"; $FTPDataPass = "asd@test.de"; $docName = "index.html"; $ftpConn = ftp_connect($FTPDataHost); $ftpLogin = ftp_login($ftpConn, $FTPDataUser, $FTPDataPass); if($ftpConn && $ftpLogin){ $fp = fopen($docName, "w"); echo "ftp conn : " . $ftpConn . "<br>"; if(!ftp_fget($ftpLogin, $fp, trim($docName), FTP_BINARY)) echo "error"; fclose($fp); } ftp_quit($ftpLogin); } } $newImport1 = new ftpimport; // this works $newImport1->GetViaFTP(); // this works $newImport2 = new ftpimport; // this causes the problem $newImport2->GetViaFTP(); // this causes the problem ?> A solution would be: $ftpLogin = ftp_login(ftp_connect($FTPDataHost), $FTPDataUser, $FTPDataPass); Instead of: $ftpConn = ftp_connect($FTPDataHost); $ftpLogin = ftp_login($ftpConn, $FTPDataUser, $FTPDataPass); ------------------------------------------------------------------------ [2001-10-31 06:13:56] j.parree@net-communications.de A working example: This example should download an html-file. <? class ftpimport{ function GetViaFTP(){ $FTPDataHost = "212.227.140.167"; $FTPDataUser = "anonymous"; $FTPDataPass = "asd@test.de"; $docName = "index.html"; $ftpConn = ftp_connect($FTPDataHost); $ftpLogin = ftp_login($ftpConn, $FTPDataUser, $FTPDataPass); if($ftpConn && $ftpLogin){ $fp = fopen($docName, "w"); echo "ftp conn : " . $ftpConn . "<br>"; if(!ftp_fget($ftpLogin, $fp, trim($docName), FTP_BINARY)) echo "error"; fclose($fp); } ftp_quit($ftpLogin); } } $newImport1 = new ftpimport; // this works $newImport1->GetViaFTP(); // this works $newImport2 = new ftpimport; // this causes the problem $newImport2->GetViaFTP(); // this causes the problem ?> A solution would be: $ftpLogin = ftp_login(ftp_connect($FTPDataHost), $FTPDataUser, $FTPDataPass); Instead of: $ftpConn = ftp_connect($FTPDataHost); $ftpLogin = ftp_login($ftpConn, $FTPDataUser, $FTPDataPass); ------------------------------------------------------------------------ [2001-10-30 18:05:33] sniper@php.net Please add a SHORT but complete and self-containing script that uses some public ftp server. And with which this can be reproduced. --Jani ------------------------------------------------------------------------ [2001-10-30 07:14:44] j.parree@net-communications.de We are getting the following undocumented error: Warning: Unable to find ftpbuf 1 in /usr/local/httpd/htdocs/sportshop/admin/modules/porter/class/classProductImport.php on line 18 (Line: if(!ftp_fget($ftpLogin, trim($docName), $fp, FTP_BINARY)); ) This script is also beeing called from another script on the same mashine, and there it works. (We could nor get any information from search engines or any of the php-mailing lists.) ------------------------------------- In script (part of a class): $ftpConn = ftp_connect($FTPDataHost); $ftpLogin = ftp_login($ftpConn, $FTPDataUser, $FTPDataPass); if($ftpConn && $ftpLogin){ $fp = fopen($tmpDataDir . "/" . trim($docName), "w"); echo "ftp conn : " . $ftpConn . "<br>"; if(!ftp_fget($ftpLogin, trim($docName), $fp, FTP_BINARY)); fclose($fp); } ------------------------------------- -> modules in php ... : './configure' '--prefix=/usr' '--bindir=/usr/bin' '--libdir=/usr/lib' '--with-config-file-path=/etc' '--with-exec-dir=%{libdir}/php/bin' '--with-pgsql=/usr' '--with-mysql=/usr' '--with-gd=yes' '--with-tiff-dir=/usr' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--with-xpm-dir=/usr/X11R6' '--with-pdflib=/usr' '--with-ldap=yes' '--with-imap=yes' '--with-imap-ssl' '--with-zlib=yes' '--with-bz2' '--with-xml' '--with-ttf' '--with-t1lib' '--with-mcal=/usr/include/mcal/' '--with-sablot' '--with-readline' '--with-ftp' '--with-ndbm' '--with-gdbm' '--with-mcrypt' '--with-gettext' '--with-curl' '--with-mm' '--with-gd=yes' '--with-qtdom=/usr/lib/qt-2.2.1/' '--enable-versioning' '--enable-yp' '--enable-bcmath' '--enable-trans-sid' '--enable-inline-optimization' '--enable-track-vars' '--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-shmop' '--enable-calendar' '--enable-exif' '--enable-ftp' '--enable-memory-limit' '--enable-wddx' '--enable-filepro' '--enable-dbase' '--enable-ctype' '--enable-debug' '--enable-force-cgi-redirect' '--enable-discard-path' '--enable-sigchild' '--enable-gd-imgstrttf' '--with-openssl' '--with-swf=./dist/' '--with-apxs=/usr/sbin/apxs' 'i386-suse-linux-gnu' ------------------------------------- Other information: - Total script processing time = 0.034132000058889 - FTP-Settings on the remotehost were checked ! ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=13868&edit=1

« previous php.dev (#69408) next »