I am coding a script to fetch large files (~100MB) off a server. Which is a better method of fetching the file? 1. Through wget via shell_exec() or similar 2. Through fopen()? 3. Other method I want the best method that uses the least memory usage. At the moment, I'm thinking of the 1st option as being the best. Any thoughts?
First what are you using it for ? wget is great on it's own to mirror sites it can actually parse links from pages and download files. fopen is not to hot especially for large files, if you must use php use curl as it's much easier to use and more efficient.
For bigger files, wget is good. You can also use curl too with required options and arguments. (best option; less resource usage with php scripts)