pecl の oauth のバージョン違いによって以前のコードが動作しない場合がある

今までAWSのmicro instanceを使っていましたが、意外と金額がかさむので、spacerichのVPSに移動してMyTwitter-WebAPIを動作させようとしたけど、AWSで動いてたコードが、動かないという状況がありました。spacerichのVPSの問題かと思って、さくらのVPSでも試したところ、同じ現象。エラーメッセージは、以下。

[Wed Mar 02 03:25:28 2011] [error] [client xxx.xxx.xxx.xxx] PHP Fatal error:  Uncaught exception 'OAuthException' with message 'Invalid auth/bad request (got a 401, expected HTTP/1.1 20X or a redirect)

結論

2011-03-02現在、pecl で oauth のバージョン番号を指定せずにインストールした場合、1.1.0がインストールされます。

$ sudo pecl install oauth

しかし、このバージョンにバグが残っているようで、@fukataの提案により、oauth-1.0.0を使ってみたら、今までのコードが難なく動作しました。pecl install oauthで入るバージョンに、問題があるとか恐ろしい。

インストールしたoauthをアンインストールしてから、1.0.0指定で再インストールすれば解決します。

$ sudo pecl uninstall oauth
$ sudo pecl install oauth-1.0.0

もう、いろいろ気力が削がれたので、追跡終了します。

4件のコメント

  • 同じ所でひっかかっていました。 記事の通りバージョンを戻したらすんなりいきました! ありがとうございます。

  • I have read a few good stuff here. Definitely price bookmarking for revisiting. I wonder how much effort you set to create one of these wonderful informative website.

  • I enjoy what you guys are usually up too. This sort of clever work and reporting!

    Keep up the excellent works guys I’ve added you guys to our blogroll.

  • Very good blog you have here but I was wanting to know if you knew of any discussion boards that cover the same topics talked about in this article? I’d really like to be a part of group where I can get feed-back from other knowledgeable people that share the same interest. If you have any recommendations, please let me know. Thank you!

1件のピンバック

コメントする

メールアドレスが公開されることはありません。 が付いている欄は必須項目です


The reCAPTCHA verification period has expired. Please reload the page.

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください