13
The error means safe_mode or open_basedir ARE enabled (probably open_basedir) you probably can't override either if your host has any decent security settings.
這個錯誤意味着已經啟用了safe_mode或open_basedir(可能是open_basedir),如果您的主機有任何像樣的安全設置,您可能也無法覆蓋它們。
So you have a choice
所以你有一個選擇
1) change host (not really desirable I imagine)
1)更換主機(我想不是很理想)
2) use a function similar to ones found on the php curl_setopt page, i.e. http://www.php.net/manual/en/function.curl-setopt.php#95027
2)使用與php curl_setopt頁面類似的函數,即http://www.php.net/manual/en/function.curl-setopt.php#95027
The following is a fixed version of the function specified in point 2
下面是點2中指定的函數的固定版本
function curl_redirect_exec($ch, &$redirects, $curlopt_header = false) {
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$data = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($http_code == 301 || $http_code == 302) {
list($header) = explode("\r\n\r\n", $data, 2);
$matches = array();
preg_match("/(Location:|URI:)[^(\n)]*/", $header, $matches);
$url = trim(str_replace($matches[1], "", $matches[0]));
$url_parsed = parse_url($url);
if (isset($url_parsed)) {
curl_setopt($ch, CURLOPT_URL, $url);
$redirects++;
return curl_redirect_exec($ch, $redirects, $curlopt_header);
}
}
if ($curlopt_header) {
return $data;
} else {
list(, $body) = explode("\r\n\r\n", $data, 2);
return $body;
}
}