2012-01-28 7 views
1

私は(redisent経由でのRedisを使用しています)PHP Resqueを使用しようとしているが、私はこのエラーを取得しておいてください。Resque PHP(Redisの誤り?)

Warning: fsockopen() expects parameter 2 to be long, string given in 
/home/***/public_html/codes/ao/resque/lib/Redisent/Redisent.php on line 56 

Fatal error: Uncaught exception 'Exception' with message ' - ' in 
/home/***/public_html/codes/ao/resque/lib/Redisent/Redisent.php:58 Stack trace: #0 
/home/***/public_html/codes/ao/resque/lib/Redisent/Redisent.php(52): Redisent- 
>establishConnection() #1 /home/***/public_html/codes/ao/resque/lib/Resque.php(38): 
Redisent->__construct('redis', '//***') #2 /home/***/public_html/cons/db.php(6): 
Resque::setBackend('redis://***...') #3 {main} thrown in 
/home/***/public_html/codes/ao/resque/lib/Redisent/Redisent.php on line 58 

私が間違っているかを把握することはできません。私を助けてください!

答えて

2

エラーダンプの最初の行に問題が示されています。

fsockopen() expects parameter 2 to be long, string given in 
    in /home/***/public_html/codes/ao/resque/lib/Redisent/Redisent.php on line 56 

fsockopen()の2番目のパラメータはポート番号です。どういうわけか、あなたはそれに文字列を渡しています。

残りのエラーは単に接続が失敗したためです。

Redisent.php source codeを見ると、無効なパラメータをRedisentオブジェクトのコンストラクタに渡す必要があるようです。あなたが何か持っているあなたのソースコードでは、

$foo = new Redisent('hostname', '32323'); // See the bug? 

を... 2番目のパラメータは文字列でないことを確認してください。

正しいだろう次

$foo = new Redisent('hostname', 32323); // no quotes around port number! 
+0

I 'ラン:fsockopenの( 'Redisの:// neex1233:******************** ******@stingfish.redistogo.com:9154/'); '私はこのエラーを受け取ります: '警告:fsockopen()[function.fsockopen]:redisに接続できません:// neex1233:*** *********************** @ stingfish.redistogo.com:9154(ソケット転送 "redis"を見つけることができません - あなたがそれを有効にするのを忘れましたか?あなたはPHPを設定しましたか?)/home/username/public_html/cons/db.php on line 6'私はこれを推測しています。 – user1174824

+0

これは別の明白な1つです。 "redis://"接頭辞をなくしてください。最初のパラメータは単純にホスト名です。 Redisent.phpはPHPソケット転送を追加しません。これは、Redisentのドキュメントにすべて載っています。 私の元の回答は受け入れたものとしてマークしてください。ありがとう! –

関連する問題