php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13868 Unable to find ftpbuf 1 in ....
Submitted: 2001-10-30 07:14 UTC Modified: 2002-06-02 13:51 UTC
From: j dot parree at net-communications dot de Assigned:
Status: Closed Package: FTP related
PHP Version: 4.0.4pl1 OS: Suse 7.1 - oldwotan 2.4.3 #1
Private report: No CVE-ID: None
 [2001-10-30 07:14 UTC] j dot parree at net-communications dot 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 !

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-10-30 18:05 UTC] 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-31 06:13 UTC] j dot parree at net-communications dot 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:15 UTC] j dot parree at net-communications dot 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:16 UTC] j dot parree at net-communications dot 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:19 UTC] j dot parree at net-communications dot de
Your site has some strange loading problems.
Sorry, for posting this for three times.
 [2002-06-02 13:51 UTC] derick@php.net
Please try the latest snapshot from snaps.php.net (the non stable one) and reopen if this problem is not fixed.

Derick
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 09:01:28 2024 UTC