【问题标题】:PHP file get content errorPHP文件获取内容错误
【发布时间】:2013-03-02 10:59:27
【问题描述】:

在下面的代码中我得到错误failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request

        $url = "https://graph.facebook.com/$orderId";
        $url_with_token = $url . "?access_token=$token";
        $result= json_decode(file_get_contents($url_with_token));

请告诉我哪里出错了

【问题讨论】:

  • 请检查令牌。
  • $orderId$token 可能有问题?在之前打印$url_with_token,看看那里有什么。
  • 当我在浏览器中粘贴$url_with_token 时,我得到了正确的结果

标签: php facebook file-get-contents


【解决方案1】:

只需在 php.ini 文件中添加两行。

extension=php_openssl.dll

allow_url_include = On

它对我有用。

【讨论】:

    猜你喜欢
    • 2016-03-04
    • 2010-11-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-10-01
    相关资源
    最近更新 更多