php获取openid数据库识别不出,php – OpenID登录代码在实时服务器中失败

我已经解决了问题并找到了解决方法. request()方法进行一些自动检测以找出如何建立HTTP连接:

protected function request($url, $method='GET', $params=array(), $update_claimed_id=false)

{

if (function_exists('curl_init')

&& (!in_array('https', stream_get_wrappers()) || !ini_get('safe_mode') && !ini_get('open_basedir'))

) {

return $this->request_curl($url, $method, $params, $update_claimed_id);

}

return $this->request_streams($url, $method, $params, $update_claimed_id);

}

在我的开发框中使用CURL但在我的实时框中它使用file_get_contents(),因为检查失败.原因是open_basedir指令不为空.

如果我强制LightOpenID使用CURL,一切都运行顺利.

更新#1:LightOpenID在确定卷曲不可用时是正确的.我在日志文件中找到了这个:

CURLOPT_FOLLOWLOCATION cannot be activated when safe_mode is enabled

or an open_basedir is set

至于file_get_contents()版本,我怀疑我在库中发现了一个拼写错误:

Index: lightopenid/openid.php

===================================================================

--- lightopenid/openid.php (0.60)

+++ lightopenid/openid.php (working copy)

@@ -349,7 +349,7 @@

$this->headers = $this->parse_header_array($http_response_header, $update_claimed_id);

}

- return file_get_contents($url, false, $context);

+ return $data;

}

protected function request($url, $method='GET', $params=array(), $update_claimed_id=false)

我已经通知了作者,他确认这是一个错误.我会报告它是否得到修复.

更新#2:2012年6月在master分支中的错误was fixed.它仍然不是稳定版本的一部分,但可以从code repository下载.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值