【发布时间】:2018-11-26 11:15:07
【问题描述】:
我正在使用laravel 5.5.* 和guzzlehttp/guzzle ^6.3。我在同一个项目 (using laravel api.php) 中创建了 API,并在同一个项目 (using laravel web.php) 上使用 API,并给出了 throttle 120 per second。
一切正常,但在使用 guzzle 解析时突然出现以下错误
{
"error": "FatalErrorException",
"reason": "Allowed memory size of 536870912 bytes exhausted (tried to allocate 266342400 bytes)",
"code": 1,
"trace": []
}
使用XAMPP server 和memory_limit=2048M。
如果我在浏览器中访问 API,它会加载正常
Guzzle 解析代码如下
$client = new Client([
'base_uri' => env('API_URL'),
'headers' => ['Content-Type' => 'application/x-www-form-urlencoded; charset=UTF-8'],
'debug' => true,
]);
请有人帮我解决这个问题?即使我清除了缓存也生成了一个新密钥
【问题讨论】:
标签: php laravel laravel-5.5 guzzle guzzle6