什么是CURLOPT_IPRESOLVE? [英] What is CURLOPT_IPRESOLVE?

查看:1309
本文介绍了什么是CURLOPT_IPRESOLVE?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Codeigniter登录Facebook。
我有此错误:



遇到PHP错误



严重性:通知



消息:使用未定义的常量CURLOPT_IPRESOLVE-假定为CURLOPT_IPRESOLVE




$ b



我在StackOverflow上看过。我必须更新CURL,但是我该怎么做呢?
我的网站在免费的托管服务器上( http://www.000webhost.com
提前感谢。

解决方案

CURLOPT_IPRESOLVE 的cURL选项,可以使用 curl_setopt()



要引用手册,请:


允许应用程序选择在
解析主机名时使用哪种IP地址。这是唯一有趣的,当使用主机名
解析地址使用多个版本的IP,可能
值是CURL_IPRESOLVE_WHATEVER,CURL_IPRESOLVE_V4,
CURL_IPRESOLVE_V6,默认CURL_IPRESOLVE_WHATEVER。


此功能自cURL 7.10.8起可用,常数本身在PHP 5.3和更新版本中定义。



我不知道cURL< 7.10.8默认解析多个IP的地址,但是如果你仍然使用PHP 5.2并且不能升级,注释掉触发通知的行不应该破坏任何东西。 / p>

I'm making Facebook login with Codeigniter. I have this error:

A PHP Error was encountered

Severity: Notice

Message: Use of undefined constant CURLOPT_IPRESOLVE - assumed 'CURLOPT_IPRESOLVE'

Filename: libraries/base_facebook.php

Line Number: 1012

I've read about it on StackOverflow. I have to update CURL, but how do I do that? My website is on free web hosting server (http://www.000webhost.com) Thanks in advance.

解决方案

CURLOPT_IPRESOLVE is a constant defining one of cURL options that can be set with curl_setopt()

To quote the manual, it:

Allows an application to select what kind of IP addresses to use when resolving host names. This is only interesting when using host names that resolve addresses using more than one version of IP, possible values are CURL_IPRESOLVE_WHATEVER, CURL_IPRESOLVE_V4, CURL_IPRESOLVE_V6, by default CURL_IPRESOLVE_WHATEVER.

This functionality is available since cURL 7.10.8 and the constant itself is defined in PHP 5.3 and newer.

I don't know how cURL < 7.10.8 resolves addresses with more than one IP by default, but if you're still on PHP 5.2 and can't upgrade, commenting out the line that triggers the notice shouldn't break anything.

这篇关于什么是CURLOPT_IPRESOLVE?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆