Resque PHP(Redis错误?)
我正在尝试使用(它通过redisent使用Redis),但我一直遇到以下错误:Resque PHP(Redis错误?),php,redis,resque,Php,Redis,Resque,我正在尝试使用(它通过redisent使用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 ' - ' i
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
我不知道怎么了。请帮帮我 错误转储的第一行显示了问题所在
fsockopen() expects parameter 2 to be long, string given in
in /home/***/public_html/codes/ao/resque/lib/Redisent/Redisent.php on line 56
的第二个参数应该是端口号。不知怎的,你在传递一个字符串
接下来的其余错误都是由于连接失败造成的
在查看时,看起来您必须向Redistent对象的构造函数传递无效参数
在源代码中,您有如下内容:
$foo = new Redisent('hostname', '32323'); // See the bug?
…确保第二个参数不是字符串
以下是正确的:
$foo = new Redisent('hostname', 32323); // no quotes around port number!
当我
运行时:fsockopen('redis://neex1233:**************************@stingfish.redistogo.com:9154/')代码>我收到此错误:警告:fsockopen()[function.fsockopen]:无法连接到redis://neex1233:***************************@stingfish.redistogo.com:9154(找不到套接字传输“redis”-您在配置PHP时忘记启用它了吗?)在第6行的/home/username/public_html/cons/db.php中,我猜这与此有关。这是另一个显而易见的问题。丢失“redis://”前缀。第一个参数就是主机名。php不添加php套接字传输。这在Redistent文档中是正确的。请将我的原始答案标记为已接受。谢谢