curl Out of memory

fishzhang

问题描述

代理里有通过curl调用API接口,请求和响应都是XML格式,但是会不定时出现Out of memory.
一开始以为是memory_limit配置小了,后来检查了配置远大于异常提示的限制
不知道问题会出现在哪里

程序代码

这里粘代码

$connection = curl_init();
//请求的URL地址
curl_setopt($connection, CURLOPT_URL, $this->serverUrl);
//使用HTTPS协议,服务器端不需要身份验证
curl_setopt($connection, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($connection, CURLOPT_SSL_VERIFYHOST, false);
//http header
curl_setopt($connection, CURLOPT_HTTPHEADER, $headers);
//设置POST请求方式
curl_setopt($connection, CURLOPT_POST, true);
//设置请求的XML内容
curl_setopt($connection, CURLOPT_POSTFIELDS, $requestBody);
curl_setopt($connection, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($connection);
curl_close($connection);

报错信息

这里粘贴报错

Out of memory

319 1 0
1个回答

walkor

百度下 php curl Out of memory,有教程解决

🔝