Use of undefined constant CURLOPT_IPRESOLVE - assumed 'CURLOPT_IPRESOLVE'

半世苍凉 提交于 2019-12-31 05:35:12

问题


i have http://www.idiotminds.com/login-with-facebook-in-codeigniter/ but i have error

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

and i fix CURLOPT_SSL_VERIFYPEER => false, but not fixed

but i have enable the php_curl

**

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

**

code

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

it still not work help me please BIG THANKS


回答1:


CURLOPT_IPRESOLVE is available only >= CURL version 7.10.8 and your CURL version is 7.24.0. Need to update CURL in order for that CONSTANT to be available. And support for this constant is only available for PHP>=5.3

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




回答2:


Yes, you may get latest curl. But you still have to install php-curl for php. you chould check whether you have or not have it.

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


来源:https://stackoverflow.com/questions/15736529/use-of-undefined-constant-curlopt-ipresolve-assumed-curlopt-ipresolve

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!