#40389 [Opn->Fbk]: ftp_put() function is very slow

From: Date: Wed, 07 Feb 2007 15:35:02 +0000
Subject: #40389 [Opn->Fbk]: ftp_put() function is very slow
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-108546@lists.php.net to get a copy of this message
ID: 40389 Updated by: tony2001@php.net Reported By: afuzaylov at mlgpro dot com -Status: Open +Status: Feedback Bug Type: Unknown/Other Function Operating System: windows xp PHP Version: 5.2.0 New Comment: Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If the script requires a database to demonstrate the issue, please make sure it creates all necessary tables, stored procedures etc. Please avoid embedding huge scripts into the report. Previous Comments: ------------------------------------------------------------------------ [2007-02-07 15:26:37] afuzaylov at mlgpro dot com Description: ------------ Hi. I have created a small php file to FTP .swf files to another server. It seems to run very very slow compared to another FTP program. It takes filezilla 1.5 minutes to upload 31MB .swf file, while it takes PHP to upload it about 3 hours. I am running on windows xp apache2, PHP 5.2. Reproduce code: --------------- function ftp($file_name) { $conn_id = ftp_connect(FTP_SERVER); $login_result = ftp_login($conn_id, FTP_USERNAME, FTP_PASSWORD); if ($conn_id && $login_result) { set_time_limit(60 * 60 * 4); // 4 hours from now $upload = ftp_put($conn_id, FTP_PATH . $file_name, DIRECTORY_DESTINATION . $file_name, FTP_BINARY); } ftp_close($conn_id); if ($upload) { return TRUE; } return FALSE; } $file_name = "test.swf"; $uploaded = ftp($file_name); if ($uploaded) { // do something } else { // do something } } Expected result: ---------------- It should not take 3 hours to upload a file while it takes other FTP programs less than 2 minutes. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=40389&edit=1

« previous php.bugs (#108546) next »