开发者社区> 问答> 正文

用PHP访问云oss图片服务器时,提示找不到这个常量。常量要定义成什么?

Notice : Use of undefined constant CURLOPT_CLOSEPOLICY - assumed 'CURLOPT_CLOSEPOLICY' in





public function prep_request()
    {
        $curl_handle = curl_init();


        // Set default options.
        curl_setopt($curl_handle, CURLOPT_URL, $this->request_url);
        curl_setopt($curl_handle, CURLOPT_FILETIME, true);
        curl_setopt($curl_handle, CURLOPT_FRESH_CONNECT, false);
        curl_setopt($curl_handle, CURLOPT_CLOSEPOLICY, CURLCLOSEPOLICY_LEAST_RECENTLY_USED);//就这两个东西? 我找了PHP最新的代码库没看到这个东西呀。
        curl_setopt($curl_handle, CURLOPT_MAXREDIRS, 5);
        curl_setopt($curl_handle, CURLOPT_HEADER, true);
        curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($curl_handle, CURLOPT_TIMEOUT, 5184000);
        curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 120);
        curl_setopt($curl_handle, CURLOPT_NOSIGNAL, true);
        curl_setopt($curl_handle, CURLOPT_REFERER, $this->request_url);
        curl_setopt($curl_handle, CURLOPT_USERAGENT, $this->useragent);
        curl_setopt($curl_handle, CURLOPT_READFUNCTION, array($this, 'streaming_read_callback'));

展开
收起
wy_szrjk 2015-08-27 18:07:38 6171 0
2 条回答
写回答
取消 提交回答
  • 码农|Coder| Pythonista
    Re:用PHP访问云oss图片服务器时,提示找不到这个常量。常量要定义成什么 ..
    您好
    PHP5.6移除相关变量
    具体可参考 https://bugs.php.net/bug.php?id=68147
    2015-08-28 00:42:30
    赞同 展开评论 打赏
  • Re:用PHP访问云oss图片服务器时,提示找不到这个常量。常量要定义成什么 ..
    你的运行环境是什么呀?
    2015-08-28 00:38:02
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
OSS运维进阶实战手册 立即下载
《OSS运维基础实战手册》 立即下载
OSS运维基础实战手册 立即下载