What I want to do:
User hit the URL (ex: BASE-URL / download / json).
The code extracts huge data from the database and stream into a JSON file, and the user is prompted to download this file.
What I tried:
Created a large (700 MB) JSON file. I tried to open it with the code, but the error was thrown.
file_get_contents ($ file)
Mistake:
The allowed memory size in XXX bytes has been exhausted (tried to allocate YYY bytes)
I work in symfony2. Data can be up to 700 MB in size. Cannot increase allocated memory. How can i achieve this? Please comment if any further information is required.