From: evans at datahost dot gr
Operating system: Fedora Core 3 & (Kernel 2.6.9)
PHP version: 4.3.9
PHP Bug Type: FTP related
Bug description: Warning: ftp_put(): PORT command successful in...
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 bug report at http://bugs.php.net/?id=30894&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30894&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=30894&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=30894&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=30894&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=30894&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=30894&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=30894&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=30894&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=30894&r=support
Expected behavior: http://bugs.php.net/fix.php?id=30894&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=30894&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=30894&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=30894&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30894&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=30894&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=30894&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=30894&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=30894&r=float
MySQL Configuration Error: http://bugs.php.net/fix.php?id=30894&r=mysqlcfg