Bug #63937 [NEW]: Upload speed 10 times slower with PHP

From: Date: Tue, 08 Jan 2013 07:49:04 +0000
Subject: Bug #63937 [NEW]: Upload speed 10 times slower with PHP
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-175863@lists.php.net to get a copy of this message
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

« previous php.bugs (#175863) next »