我已经按照这指南(与修改)使用光头I作为我的CI系统登录。
我下载了openid.php文件并将其放在根文件夹(应用程序、资产等文件夹所在的文件夹中)。
在登录页面中,我有以下代码:
<a href="<?php echo base_url('logingoogle/gmail_login');?>" target="_blank">Login using gmail</a>我的应用程序/控制器/logingoogle.php中的代码如下:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
Class Logingoogle extends CI_Controller {
function __construct(){
parent::__construct();
}
function index(){}
function gmail_login(){
require_once 'openid.php';
$openid = new LightOpenID(base_url());
$openid->identity = 'https://www.google.com/accounts/o8/id';
$openid->required = array(
'namePerson/first'
,'namePerson/last'
,'contact/email'
);
$openid->returnUrl = base_url('logingoogle/after_login');
$openid->authUrl();
}
function after_login(){
require_once 'openid.php';
$openid = new LightOpenID(base_url());
$login_response = '';
$email = '';
$first = '';
if ($openid->mode) {
if ($openid->mode == 'cancel') {
$login_response = "User has canceled authentication!";
} elseif($openid->validate()) {
$data = $openid->getAttributes();
$email = $data['contact/email'];
$first = $data['namePerson/first'];
} else {
$login_response = "The user has not logged in";
}
}
else{
$login_response = "Go to index page to log in.";
}
$data['user_details'] = array(
'login_response' => $login_response
,'identity' => $openid->identity
,'email' => $email
,'first' => $first
);
$this->load->view('after_login',$data);
}
}现在,当我点击“”链接时,它会打开一个新的空白选项卡,加载5分钟(我已经计时过了)。5分钟后,此错误将以纯文本显示:
致命错误:异常'ErrorException‘与消息’失败连接到www.google.com:443;在C:\WebServer\Apache2.2\htdocs\ETO\openid.php:229堆栈跟踪中没有错误:#0 C:\WebServer\Apache2.2\htdocs\ETO\openid.php(360):LightOpenID->C:\WebServer\Apache2.2\htdocs\ETO\openid.php(360):_curl(‘https://www.goo.’,'GET',Array,true) #1 C:\WebServer\Apache2.2\htdocs\ETO\openid.php(499):LightOpenID->请求(‘https://www.goo.’,'GET',C:\WebServer\Apache2.2\htdocs\ETO\openid.php(499):#2 C:\WebServer\Apache2.2\htdocs\ETO\openid.php(671):LightOpenID->发现(‘https://www.goo.’) #3 C:\WebServer\Apache2.2\htdocs\ETO\application\controllers\logingoogle.php(30):LightOpenID->authUrl() #4内部函数: Logingoogle->gmail_login() #5 C:\WebServer\Apache2.2\htdocs\ETO\system\core\CodeIgniter.php(359):call_user_func_array(C:\WebServer\Apache2.2\htdocs\ETO\system\core\CodeIgniter.php(359):call_user_func_array)数组) #6 C:\WebServer\Apache2.2\htdocs\ETO\index.php(206):require_once(‘C:\WebServer\Ap.’) #7 {main}抛入第229行的C:\WebServer\Apache2.2\htdocs\ETO\openid.php中。
以前有没有人遇到过类似的错误?我做错了什么?我无法破解给我的错误信息。请帮帮忙。
https://stackoverflow.com/questions/23050167
复制相似问题