【问题标题】:Use of undefined constant CURLOPT_IPRESOLVE - assumed 'CURLOPT_IPRESOLVE'使用未定义的常量 CURLOPT_IPRESOLVE - 假定为“CURLOPT_IPRESOLVE”
【发布时间】:2013-04-01 01:36:22
【问题描述】:

我有http://www.idiotminds.com/login-with-facebook-in-codeigniter/ 但我有错误

> A PHP Error was encountered
> 
> Severity: Notice
> 
> Message: Use of undefined constant CURLOPT_IPRESOLVE - assumed
> 'CURLOPT_IPRESOLVE'
> 
> Filename: facebook/base_facebook.php

我修复了 CURLOPT_SSL_VERIFYPEER => false, 但不固定

但我已启用 php_curl

**

cURL support enabled
cURL Information libcurl/7.24.0 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5

**

代码

public static $CURL_OPTS = array(
    CURLOPT_CONNECTTIMEOUT => 10,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT        => 60,
    CURLOPT_USERAGENT      => 'facebook-php-3.2',
    CURLOPT_SSL_VERIFYPEER => false
  );

还是不行 请帮帮我 非常感谢

【问题讨论】:

  • 需要 CURL_YOURCODE :) 才能在这里为您提供帮助
  • 我更新了我的代码。谢谢你

标签: facebook codeigniter codeigniter-url


【解决方案1】:

是的,你可能会得到最新的 curl。但是你仍然需要为 php 安装 php-curl。 你应该检查你有没有。

php -i |grep curl
//this will be return in your linux command line.
/etc/php/7.1/cli/conf.d/20-curl.ini,
curl

【讨论】:

    【解决方案2】:

    CURLOPT_IPRESOLVE 仅适用于 >= CURL 版本 7.10.8 并且您的 CURL 版本是 7.24.0。需要更新 CURL 才能使该 CONSTANT 可用。并且对这个常量的支持仅适用于 PHP>=5.3

    参考:http://gcov.php.net/PHP_5_3/lcov_html/curl/interface.c.gcov.php

    【讨论】:

    • 谢谢你,我现在去看看。如果它不起作用,我会回复继续
    • @Hanky:7.24.0 似乎大于 7.10.8,不是吗?
    猜你喜欢
    • 2012-06-28
    • 2015-07-11
    • 2014-05-07
    • 2014-04-30
    • 2013-12-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多