If the files are LARGE, file_get_contents is a Bad Idea (tm).


You're trying to suck the whole thing into RAM, which it can't, which swaps and 
thrashes the bleep out of your RAM/swap space...



Use fopen and an fread loop instead, and you'll probably see much better 
performance.



Also, consider going old school and getting rid of the stream_context stuff.  
It's "new" and "untested" :-)



You can use ini_set and the parameter or even fall back to fsockopen with a 
timeout.



Note that those time-outs are for any given packet to arrive (or the socket to 
open) not the whole enchilada to download.



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

Reply via email to