You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before i start, this is not a duplicate to #903, this is about Swoole.
Also large stream responses are fixed with #636, but not this case.
While using Storage::download or Storage::response, laravel is creating a stream response that uses php fpassthru($stream).
Somehow the buffering between fpassthru and ob_start does not work, instead it tries to load the full file into the memory.
This leads to out of memory errors while downloading very big files.
If i replace the fpassthru with a fread-while-loop it is working as expected.
I can basically make a pull request, but need help with the solution...
Is this more a problem in the laravel framework or PHP itself?
Steps To Reproduce
Write a laravel controller that uses Storage::download() to download file with e.g. 1 GB
Call the controller and see the out of memory error
The text was updated successfully, but these errors were encountered:
As Laravel is an open source project, we rely on the community to help us diagnose and fix issues as it is not possible to research and fix every issue reported to us via GitHub.
If possible, please make a pull request fixing the issue you have described, along with corresponding tests. All pull requests are promptly reviewed by the Laravel team.
Octane Version
2.6.2
Laravel Version
11.16.0
PHP Version
8.3.6
What server type are you using?
Swoole
Server Version
5.1.2
Database Driver & Version
No response
Description
Before i start, this is not a duplicate to #903, this is about Swoole.
Also large stream responses are fixed with #636, but not this case.
While using Storage::download or Storage::response, laravel is creating a stream response that uses php fpassthru($stream).
Somehow the buffering between fpassthru and ob_start does not work, instead it tries to load the full file into the memory.
This leads to out of memory errors while downloading very big files.
If i replace the fpassthru with a fread-while-loop it is working as expected.
I can basically make a pull request, but need help with the solution...
Is this more a problem in the laravel framework or PHP itself?
Steps To Reproduce
The text was updated successfully, but these errors were encountered: