我从flipkart的affiliation API获取产品。 但经过大量的json之后,我得到了以下错误。
Fatal error: Out of memory (allocated 223084544) (tried to allocate 65488 bytes)
我的代码是
$ch = curl_init();
curl_setopt(
$ch, CURLOPT_HTTPHEADER,
array(
"Fk-Affiliate-Id:$Affliate_ID",
"Fk-Affiliate-Token:$Token",
"Accept:application/json"
)
);
// Disable SSL verification
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
// Will return the response, if false it print the response
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Set the url
curl_setopt($ch, CURLOPT_URL,$endpoint);
// Execute
$result=curl_exec($ch);
// Closing
curl_close($ch);
即使我尝试定义函数并将内存增加到512B,但我仍然遇到同样的问题。