ID: 30894 Comment by: lafriks at hello dot lv Reported By: evans at datahost dot gr Status: Open Bug Type: FTP related Operating System: Fedora Core 3 & (Kernel 2.6.9) PHP Version: 4.3.9 New Comment:
I have the same warning and uploaded file is 0 bytes. I'm usnig Mandrake Cooker and have apache2-mod_php5-2.0.52_5.0.3-1mdk Previous Comments: ------------------------------------------------------------------------ [2005-01-07 21:35:36] evans at datahost dot gr After various tests I am almost sure that some library from Fedora Core (after the default install i do a yum update) affects PHP. With the default installation of Fedora Core 1 I never had the problem described above. Now I reinstalled Fedora Core 1 and I did a yum update and changed some libraries with new ones. I also changed the kernel to 2.4.28 (manually compiled) and I get again the error with ftp_put(). p.s.: The problem exists in PHP 4.3.10 ------------------------------------------------------------------------ [2005-01-07 19:03:08] linhaibo at hotmail dot com wait 90s later,display: Warning: ftp_put(): Opening BINARY mode data connection for 1105119149_new.rm. 1105119149_new.rm is remote server file uploads the file, but its size also is 0 byte. ------------------------------------------------------------------------ [2004-11-27 20:39:40] evans at datahost dot gr Still doesn't work. I compiled the latest Snapshop (with the same configure command i quoted above) and i get the same warning. Warning: ftp_put(): PORT command successful in /home/www/www/index.php on line 16 The file gets uploaded but its size is 0 bytes. As long as I remember when I was trying Fedora Core 2 the problem was with a different/older version of PHP. ------------------------------------------------------------------------ [2004-11-27 09:21:22] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php4-STABLE-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-STABLE-latest.zip Works fine here. ------------------------------------------------------------------------ [2004-11-25 10:29:55] evans at datahost dot gr Description: ------------ I have just installed Fedora Core 3 and compiled PHP 4.3.9 Everything works fine except my php scripts that user the ftp_put function. On fedora core 1 there was no problem at all and i haven't changed anything to the scripts or the compilation of PHP. The error that ftp_put returns is: Warning: ftp_put(): PORT command successful in /home/www/www/test.php on line 16 PHP Connects successfuly to the FTP Server (Proftpd 1.2.9) it uploads the file but its size is 0 bytes. The same problem was also in Fedora Core 2. I Heard that FC2 has several problems with some libraries so i didn't searched further for it. I Also tried to enable the passive mode (as i read in several forums) with no result. Even the code as it is on the PHP Manual doesn't work. I suppose it is not a problem of permissions as it uploads a file to the ftp server but as i said its size is 0 bytes. Is there a possibility that PHP's ftp_functions doesn't work correct with kernels 2.6.x ? My configure command follows : './configure' '--with-apxs=/usr/local/apache/bin/apxs' '--enable-track-vars' '--enable-ftp' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-sigchild' '--enable-sockets' '--enable-gd-native-ttf' '--enable-gd-imgstrttf' '--enable-gd-imgstrtt' '--enable-gd-native-tt' '--enable-bcmath' '--enable-dio' '--enable-mcal' '--enable-mbstring' '--enable-mbstr-enc-trans' '--enable-shmop' '--enable-versioning' '--enable-calendar' '--enable-memory-limit' '--enable-trans-sid' '--enable-magic-quotes' '--enable-pic' '--enable-yp' '--enable-wddx' '--enable-dbx' '--enable-cli' '--enable-inline-optimization' '--enable-force-cgi-redirect' '--enable-ucd-snmp-hack' '--enable-filepro' '--enable-exif' '--enable-dbase' '--enable-dba' '--enable-zend-multibyte' '--enable-static' '--enable-shared' '--enable-fast-install' '--with-pdflib=/usr/local' '--with-mm=/usr/local' '--with-swf=/usr/local' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr/local' '--with-freetype-dir=/usr/local' '--with-imap=/usr/local/imap-2004b' '--with-kerberos' '--with-mysql=/usr/local/mysql' '--with-zip=/usr/local' '--with-bz2=/usr/local' '--with-zlib=/usr/local' '--with-openssl=/usr/local/ssl' '--with-imap-ssl=/usr/local' '--with-gettext=/usr/local' '--with-curl=/usr/local' '--with-mhash=/usr/local' '--with-layout=GNU' '--with-gd' '--with-ttf' '--with-xml' '--with-gdbm' '--with-iconv' '--with-ncurses' '--with-hyperwave' '--with-gmp' '--with-tsrm-pthreads' '--with-db4' '--with-xml' '--with-pear' '--with-ldap' '--with-mime-magic' The php.ini doesn't have any weird modifications except that i enabled Register_Globals. Thank you in advance, Evans C. Koutroumpas. Reproduce code: --------------- <?php error_reporting(E_ALL); $ftp_server = 'localhost'; $ftp_user_name = 'www'; $ftp_user_pass = 'papastratos'; $file = 'test.gif'; $remote_file = 'test2.gif'; // set up basic connection $conn_id = ftp_connect($ftp_server); // login with username and password $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); // upload a file if (ftp_put($conn_id, $remote_file, $file, FTP_BINARY)) { echo "successfully uploaded $file\n"; } else { echo "There was a problem while uploading $file\n"; } // close the connection ftp_close($conn_id); ?> Expected result: ---------------- successfully uploaded test2.gif Actual result: -------------- Warning: ftp_put(): PORT command successful in /home/www/www/test.php on line 16 There was a problem while uploading test.gif ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=30894&edit=1