我在PHP中运行此代码
$url = "url";
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
'Authorization: Bearer numbers',
));
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_ENCODING, 'gzip,deflate,sdch');
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
$result = curl_exec($curl);
if (curl_errno($curl)) {
$error_msg = curl_error($curl);
echo $error_msg;
}
curl_close($curl);
我在这行代码上有错误
$result = curl_exec($curl);
mmap()失败:[12]无法分配内存 PHP致命错误:内存不足(已分配2000039936)(试图分配73728字节)
i PUT ini_set('memory_limit','-1');但这仍然行不通,有帮助吗?