From:             levi_tedder at hotmail dot com
Operating system: Windows
PHP version:      Irrelevant
Package:          FTP related
Bug Type:         Bug
Bug description:Upload speed 10 times slower with PHP

Description:
------------
If using ftp_put() the upload speed is 10-20 times slower that when using a

"regular" FTP client like Filezilla. Uploading with cUrl is equally slow.
Tested 
on multiple PHP versions on several Windows operating systems and on two
different 
networks, all same.

Note that downloading (ftp_get()) is equally fast as using Filezilla.

Test script:
---------------
<?php
$conn_id = ftp_connect ( "ftpserver" );
$login_result = ftp_login ( $conn_id, "username", "password" );
if ((! $conn_id) || (! $login_result)) {
        exit ( "No FTP connection" );
} else {
        ftp_pasv ( $conn_id, true );
        $size = filesize ( $localfile );
        $start_timer = time ();
        if (ftp_put ( $conn_id, "remote file", "local file", FTP_BINARY )) {
                $end_timer = time ();
                $time_spent = $end_timer - $start_timer;
                echo "Transferred $size bytes in $time_spent seconds";
        } else {
                exit ( "FTP upload error" );
        }
        ftp_close ( $conn_id );
}
?>

Expected result:
----------------
The file should be transferred at the same speed as when using a "regular"
FTP 
client like Filezilla.

Actual result:
--------------
Filezilla
File transfer successful, transferred 190 923 591 bytes in 170 seconds

PHP ftp_put()
Transferred 190 923 591 bytes in 1563 seconds

-- 
Edit bug report at https://bugs.php.net/bug.php?id=63937&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=63937&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=63937&r=trysnapshot53
Try a snapshot (trunk):     
https://bugs.php.net/fix.php?id=63937&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=63937&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=63937&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=63937&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=63937&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=63937&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=63937&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=63937&r=notwrong
Not enough info:            
https://bugs.php.net/fix.php?id=63937&r=notenoughinfo
Submitted twice:            
https://bugs.php.net/fix.php?id=63937&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=63937&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63937&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=63937&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=63937&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=63937&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=63937&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=63937&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=63937&r=mysqlcfg

Reply via email to