小编Igo*_*nin的帖子

file_get_contents('php:// input')保持返回空

我正在尝试在我的网站上设置gitkit,但无法通过这一行代码.无论我做什么,都会file_get_contents一直空着.

我已经设置了我的php.ini: always_populate_raw_post_data = On

我的环境是PHP 5.3.3,Apache 2.2.6为localhost.

这是一些代码.

在我的index.php中,我调用google API并尝试使用gmail帐户登录,换句话说,联合登录.

(这是来自Google API控制台)

<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/jquery-ui.min.js"></script>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/googleapis/0.0.4/googleapis.min.js"></script>
<script type="text/javascript" src="//ajax.googleapis.com/jsapi"></script>
<script type="text/javascript">
  google.load("identitytoolkit", "1", {packages: ["ac"], language:"en"});
</script>
<script type="text/javascript">
  $(function() {
    window.google.identitytoolkit.setConfig({
        developerKey: "HERE_GOES_MY_DEVELOPER_KEY",
        companyName: "Valentinos Pizzaria",
        callbackUrl: "http://localhost/valentinos/callback.php",
        realm: "",
        userStatusUrl: "http://localhost/valentinos/userstatus.php",
        loginUrl: "http://localhost/valentinos/login.php",
        signupUrl: "http://localhost/valentinos/register.php",
        homeUrl: "http://localhost/valentinos/index.php",
        logoutUrl: "http://localhost/valentinos/logout.php",
        idps: ["Gmail", "Yahoo"],
        tryFederatedFirst: true,
        useCachedUserStatus: false,
        useContextParam: true
    });
    $("#navbar").accountChooser();
  });
</script>
Run Code Online (Sandbox Code Playgroud)

我收到IDP响应,登录,并被要求获得权限.返回我的回调页面后,我使用了Google提供的代码示例(如下所示),这一行代码似乎没有正确返回.

我做了什么愚蠢的事吗?

任何帮助将不胜感激.

到目前为止,这里是整个callback.php(现在没有任何HTML): …

php file-get-contents

3
推荐指数
1
解决办法
2万
查看次数

标签 统计

file-get-contents ×1

php ×1