dongtazu3080 2013-07-13 10:27 采纳率: 100%
浏览 60

当我更改服务器时,Steam作为OpenID停止工作

I did a website which uses Steam as OpenID provider. I firstly hosted it on a shared hosting.

But the traffic grew from 50 users in a day to 1000 in a day. I wasn't expecting that and had to change my host. I took another shared hosting with better performance, etc. to see how it is going to grow. But there's now a problem.

My OpenID login with Steam which worked perfectly on the last host doesn't work anymore. I tried with Google, and it worked. So I don't think my script uses a functionality that isn't enabled on my new host.

So when I put Steam identity, it loads during about 30 seconds and then Chrome returns me an error, ERR_EMPTY_RESPONSE. I tried to activate error_reporting E_ALL, but it does the same.

I am using LightOpenID, and here is the portion of the code incriminated:

    $openid->identity = 'http://steamcommunity.com/openid';
    header('Location: ' . $openid->authUrl());

Actually, it doesn't work whenever I call $openid->authUrl(). Here is the complete code: http://pastebin.com/rChDzECq

How can I resolve this? Thank you in advance.

  • 写回答

1条回答 默认 最新

  • doujishao8793 2014-06-06 12:35
    关注

    I also had problems fighting the LightOpenID code in the last couple of hours. I finally made it work and here is what I learned in the process.

    1. Absolutely no HTML output before the header() command. Even the tiniest space prevented the command from redirecting anything.

    2. My server wouldn't allow the use of file_get_contents() and just returned a 404 error from the URL passed to it. You can solve this problem with a custom file_get_contents_curl() command. Here's the one I used myself:

      function file_get_contents_curl($url) {
          $ch = curl_init();
      
          curl_setopt($ch, CURLOPT_HEADER, false);
          curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
          curl_setopt($ch, CURLOPT_URL, $url);
          curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15);
      
          $data = curl_exec($ch);
          curl_close($ch);
      
          return $data;
      }
      

    I know this is a late answer but I hope it will help someone.

    评论
    编辑
    预览

    报告相同问题?

    手机看
    程序员都在用的中文IT技术交流社区

    程序员都在用的中文IT技术交流社区

    专业的中文 IT 技术社区,与千万技术人共成长

    专业的中文 IT 技术社区,与千万技术人共成长

    关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

    关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

    客服 返回
    顶部