Use of undefined constant CURLOPT_IPRESOLVE - assu

2019-03-04 08:02发布

问题:

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