We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
+---------------------------+---------+ | Component | Version | +---------------------------+---------+ | PHP | 7.4.21 | | Swoole | 4.8.12 | | LaravelS | 3.7.31 | | Laravel Framework [local] | 8.83.13 | +---------------------------+---------+
重现代码如下。
这是为什么?laravel streamDownload是用来下载大文件的,怎么和laravels+swoole配合就回超过内存限制?找了大半天不知道原因在哪里
php配置的内存限制是128M,请问应该怎么解决呢?(除了修改内存限制)
<?php namespace App\Http\Controllers; use Illuminate\Support\Str; use Illuminate\Support\Facades\Log; class IndexController extends Controller { public function export(Request $request){ return response()->streamDownload(function () { $file = fopen('php://output', 'w+'); $i=1; while ($i <= 1000000) { $data = Str::random(mt_rand(100, 200)); fputcsv($file, [$data]); $i++; } Log::info(memory_get_usage() / 1024 / 1024); fclose($file); }, 'file.csv'); } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
+---------------------------+---------+
| Component | Version |
+---------------------------+---------+
| PHP | 7.4.21 |
| Swoole | 4.8.12 |
| LaravelS | 3.7.31 |
| Laravel Framework [local] | 8.83.13 |
+---------------------------+---------+
重现代码如下。
这是为什么?laravel streamDownload是用来下载大文件的,怎么和laravels+swoole配合就回超过内存限制?找了大半天不知道原因在哪里
php配置的内存限制是128M,请问应该怎么解决呢?(除了修改内存限制)
The text was updated successfully, but these errors were encountered: