我已经使用HybridAuth将代码存储库从一台服务器移动到另一台服务器。我配置了所有的登录提供商应用程序,如Facebook/Twitter,但移动代码后,没有登录似乎是工作。
这是在HybridAuth中login.php的样子:
$config = 'library/hybridauth/config.php';
require_once("library/hybridauth/Hybrid/Auth.php");
这些文件在根目录下有一个相对路径:library/hybridauth/config.php
事实上,我像这样访问install.php: {domainName}/library/hybridauth/install.php
我var_dump了以下行:
// create an instance for Hybridauth with the configuration file path as parameter
$hybridauth = new Hybrid_Auth( $config );
var_dump($hybridauth);
,它给了我一个空的hybridauth对象
object(Hybrid_Auth)#1 (0) {
}
服务器日志也没有帮助…有什么建议吗?
调试日志:INFO -- <CURRENT_IP_ADDRESS> -- 2014-08-19T17:52:51+00:00 -- Enter Hybrid_Auth::initialize()
INFO -- <CURRENT_IP_ADDRESS> -- 2014-08-19T17:52:51+00:00 -- Hybrid_Auth::initialize(). PHP version: 5.4.31
INFO -- <CURRENT_IP_ADDRESS> -- 2014-08-19T17:52:51+00:00 -- Hybrid_Auth::initialize(). Hybrid_Auth version: 2.1.2
INFO -- <CURRENT_IP_ADDRESS> -- 2014-08-19T17:52:51+00:00 -- Hybrid_Auth::initialize(). Hybrid_Auth called from: http://<DOMAIN_NAME>/login.php?provider=Facebook
DEBUG -- <CURRENT_IP_ADDRESS> -- 2014-08-19T17:52:51+00:00 -- Hybrid_Auth initialize. dump used config: -- a:8:{s:8:"base_url";s:33:"http://<DOMAIN_NAME>/library/hybridauth/";s:9:"providers";a:10:{s:6:"OpenID";a:1:{s:7:"enabled";b:1;}s:3:"AOL";a:1:{s:7:"enabled";b:1;}s:5:"Yahoo";a:2:{s:7:"enabled";b:1;s:4:"keys";a:2:{s:2:"id";s:0:"";s:6:"secret";s:0:"";}}s:6:"Google";a:2:{s:7:"enabled";b:1;s:4:"keys";a:2:{s:2:"id";s:40:"<GOOGLE_APP_KEY>";s:6:"secret";s:24:"<GOOGLE_APP_SECRET>";}}s:8:"Facebook";a:2:{s:7:"enabled";b:1;s:4:"keys";a:2:{s:2:"id";s:16:"<FB_APP_KEY>";s:6:"secret";s:32:"<FB_APP_SECRET>";}}s:7:"Twitter";a:2:{s:7:"enabled";b:1;s:4:"keys";a:2:{s:3:"key";s:25:"<TWTR_APP_KEY>";s:6:"secret";s:50:"<TWTR_APP_SECRET>";}}s:4:"Live";a:2:{s:7:"enabled";b:1;s:4:"keys";a:2:{s:2:"id";s:0:"";s:6:"secret";s:0:"";}}s:7:"MySpace";a:2:{s:7:"enabled";b:1;s:4:"keys";a:2:{s:3:"key";s:0:"";s:6:"secret";s:0:"";}}s:8:"LinkedIn";a:2:{s:7:"enabled";b:1;s:4:"keys";a:2:{s:3:"key";s:14:"<LINKEDIN_APP_KEY>";s:6:"secret";s:16:"<LINKEDIN_APP_SECRET>";}}s:10:"Foursquare";a:2:{s:7:"enabled";b:1;s:4:"keys";a:2:{s:2:"id";s:0:"";s:6:"secret";s:0:"";}}}s:10:"debug_mode";s:2:"no";s:10:"debug_file";s:40:"library/hybridauth/debug_file/debug_file";s:9:"path_base";s:61:"/home/breakit14/public_html/<DOMAIN_NAME>/library/hybridauth/Hybrid/";s:14:"path_libraries";s:72:"/home/breakit14/public_html/<DOMAIN_NAME>/library/hybridauth/Hybrid/thirdparty/";s:14:"path_resources";s:71:"/home/breakit14/public_html/<DOMAIN_NAME>/library/hybridauth/Hybrid/resources/";s:14:"path_providers";s:71:"/home/breakit14/public_html/<DOMAIN_NAME>/library/hybridauth/Hybrid/Providers/";}
DEBUG -- <CURRENT_IP_ADDRESS> -- 2014-08-19T17:52:51+00:00 -- Hybrid_Auth initialize. dump current session: -- a:3:{s:37:"hauth_session.twitter.hauth_return_to";s:48:"s:40:"http://<DOMAIN_NAME>/login.php?provider=Twitter";";s:36:"hauth_session.twitter.hauth_endpoint";s:60:"s:52:"http://<DOMAIN_NAME>/library/hybridauth/?hauth.done=Twitter";";s:40:"hauth_session.twitter.id_provider_params";s:347:"a:5:{s:15:"hauth_return_to";s:40:"http://<DOMAIN_NAME>/login.php?provider=Twitter";s:11:"hauth_token";s:32:"8c8d4234e6dd0baadbf3ffc7a65b771f";s:10:"hauth_time";i:1408439081;s:11:"login_start";s:75:"http://<DOMAIN_NAME>/library/hybridauth/?hauth.start=Twitter&hauth.time=1408439081";s:10:"login_done";s:52:"http://<DOMAIN_NAME>/library/hybridauth/?hauth.done=Twitter";}";}
INFO -- <CURRENT_IP_ADDRESS> -- 2014-08-19T17:52:51+00:00 -- Hybrid_Auth initialize: check if any error is stored on the endpoint...
INFO -- <CURRENT_IP_ADDRESS> -- 2014-08-19T17:52:51+00:00 -- Hybrid_Auth initialize: no error found. initialization succeed.
INFO -- <CURRENT_IP_ADDRESS> -- 2014-08-19T17:52:51+00:00 -- Enter Hybrid_Auth::authenticate( Facebook )
INFO -- <CURRENT_IP_ADDRESS> -- 2014-08-19T17:52:51+00:00 -- Hybrid_Auth::authenticate( Facebook ), User not connected to the provider. Try to authenticate..
DEBUG -- <CURRENT_IP_ADDRESS> -- 2014-08-19T17:52:51+00:00 -- Enter Hybrid_Auth::setup( Facebook ) --
DEBUG -- <CURRENT_IP_ADDRESS> -- 2014-08-19T17:52:51+00:00 -- Hybrid_Auth::setup( Facebook ), no params given. Trying to get the sotred for this provider. --
INFO -- <CURRENT_IP_ADDRESS> -- 2014-08-19T17:52:51+00:00 -- Hybrid_Auth::setup( Facebook ), no stored params found for this provider. Initialize a new one for new session
DEBUG -- <CURRENT_IP_ADDRESS> -- 2014-08-19T17:52:51+00:00 -- Hybrid_Auth::setup( Facebook ). HybridAuth Callback URL set to: -- http://<DOMAIN_NAME>/login.php?provider=Facebook
INFO -- <CURRENT_IP_ADDRESS> -- 2014-08-19T17:52:51+00:00 -- Enter Hybrid_Provider_Adapter::factory( Facebook )
DEBUG -- <CURRENT_IP_ADDRESS> -- 2014-08-19T17:52:51+00:00 -- Hybrid_Provider_Model::__construct( Facebook ) initialized. dump current adapter instance:
我会启动Telerik's Fiddler之类的程序来检查线路上到底发生了什么,因为调试日志与实际发送和接收的日志是分离的。这样至少可以通过PHP代码发现Facebook是否被联系。