Re: Remote File download is very slow

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2008/8/25 Shiplu <shiplu.net@xxxxxxxxx>:
> Nothing works.
> I was using curl actually.
> It was hell slow.
> Then I added the fsockeopen option.
> Its slwo too.
> now I am thinking to add socket_* functions.
> But If dont know what is the problem how can I resolve it.
> change scheme may not solve it. :(

Ok, lets start by getting some accurate data.

Here's a script that downloads a 6Mb MP3:

<?php

$fp = fopen( "temp1.mp3", "wb" );
$ch = curl_init();

curl_setopt( $ch, CURLOPT_URL, "http://gramotunes.com/Life_is_Long.mp3"; );
curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1 );
curl_setopt( $ch, CURLOPT_FILE, $fp );

curl_exec( $ch );

curl_close( $ch );

Save it as "download.php", and run the following two commands:

time php download.php
time wget http://gramotunes.com/Life_is_Long.mp3

I get

real    0m6.105s

and

real    0m5.927s

If your results are about equal, then the problem is not with PHP.

-- 

http://www.otton.org/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux