redirect_uri URL必须是绝对的(在localhost中使用php登录Facebook)

时间:2015-03-02 15:12:33

标签: php facebook

这是我的config.php 如何从localhost将其重定向到Facebook?因为localhost没有" http://" ?

当我想登录并按下按钮时。它说" redirect_uri网址必须是绝对的"

<?php
/*!
* HybridAuth
* http://hybridauth.sourceforge.net | http://github.com/hybridauth/hybridauth
* (c) 2009-2012, HybridAuth authors | http://hybridauth.sourceforge.net/licenses.html
*/

// ----------------------------------------------------------------------------------------
//  HybridAuth Config file: http://hybridauth.sourceforge.net/userguide/Configuration.html
// ----------------------------------------------------------------------------------------
$config =array(
        "base_url" => "hybridauth/index.php", 
        "providers" => array ( 

            "Google" => array ( 
                "enabled" => true,
                "keys"    => array ( "id" => "XXXXXXXXXXXX", "secret" => "XXXXXXXX" ), 
            ),

            "Facebook" => array ( 
                "enabled" => true,
                "keys"    => array ( "id" => "XXXXXXXXXXXX", "secret" => "XXXXXXXXXXXX" ), 
            ),

        "Twitter" => array ( 
            "enabled" => true,
            "keys"    => array ( "key" => "XXXXXXXX", "secret" => "XXXXXXX" ) 
        ),
    ),
    // if you want to enable logging, set 'debug_mode' to true  then provide a writable file by the web server on "debug_file"
    "debug_mode" => false,
    "debug_file" => "debug.log",
);

1 个答案:

答案 0 :(得分:1)

localhosthttp://localhost相同。

这应该有帮助

"base_url" => "http://localhost/hybridauth/index.php"