Laravel 应用程序中的 beanstalkd 驱动程序配置错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/23213538/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
beanstalkd driver configuration error in laravel app
提问by halkujabra
I am trying to use beanstalkd
as the queue driver for my laravel app. I am getting this error when I am trying to push something on the queue.
我正在尝试beanstalkd
用作我的 laravel 应用程序的队列驱动程序。当我尝试将某些内容推送到队列时出现此错误。
Pheanstalk_Exception_ConnectionException
Socket error 111: Connection refused (connecting to localhost:11300)
Please note that in 'queue.php
' I have just changed the default driver to 'beanstalkd
' but haven't changed any settings for the driver. The settings for the driver are as follows-
请注意,在“ queue.php
”中,我刚刚将默认驱动程序更改为“ beanstalkd
”,但未更改驱动程序的任何设置。驱动程序的设置如下-
'beanstalkd' => array(
'driver' => 'beanstalkd',
'host' => 'localhost',
'queue' => 'default',
),
Please help me with this.
请帮我解决一下这个。
回答by halkujabra
Figured it out. Did these two things -
弄清楚了。做了这两件事——
$ sudo vim /etc/default/beanstalkd
> START yes # uncomment
$ sudo service beanstalkd start
# Alternatively: /etc/init.d/beanstalkd start
Got it from this link - http://fideloper.com/ubuntu-beanstalkd-and-laravel4
从这个链接得到它 - http://fideloper.com/ubuntu-beanstalkd-and-laravel4
回答by David Lartey
The answer by @halkujabra is correct. The error is because beanstalkd is not running. To fix it you just have to start beanstalkd. For MacOS use this script https://gist.github.com/finger-berlin/1942295to to that.
@halkujabra 的回答是正确的。错误是因为 beanstalkd 没有运行。要修复它,您只需启动 beanstalkd。对于 MacOS,使用此脚本https://gist.github.com/finger-berlin/1942295到那个。
- Download and save it as
script.sh
- Make it executable:
chmod a+x script.sh
- Run
./script.sh start
- 下载并另存为
script.sh
- 使其可执行:
chmod a+x script.sh
- 跑
./script.sh start