4.2 之前的laravel 不支持 redis 队列。php
安装 beanstalkd 和 supervisord:html
下载: http://kr.github.io/beanstalkd/download.htmlpython
tar zxvf beanstalkd-1.9.tar.gz cd beanstalkd-1.9 make mv beanstalkd /usr/local/bin/ yum -y install python-setuptools easy_install supervisor mkdir /etc/supervisor/ mkdir /etc/supervisor/conf.d echo_supervisord_conf > /etc/supervisor/supervisord.conf
编辑配置文件:laravel
vi /etc/supervisor/supervisord.conf
最后面添加 :git
[include] files = /etc/supervisor/conf.d/*.conf
添加 beanstalkd 服务:github
vi etc/supervisor/conf.d/beanstalkd.conf
输入:redis
[program:beanstalkd] command = /usr/local/bin/beanstalkd -l 127.0.0.1 -c
添加服务centos
vi /etc/supervisor/conf.d/queue.conf
输入code
[program:queue] user = nobody command = /usr/local/php5.4/bin/php /home/www/artisan queue:listen --timeout=180
下载你系统的*nux服务脚本: https://github.com/Supervisor/initscriptshtm
PS:我centos 选了 : redhat-init-mingalevme
修改里面的配置文件路径 改为
/etc/supervisor/supervisord.conf
启动服务:
service supervisord start
查看/管理全部服务的状态:
supervisorctl -c /etc/supervisor/supervisord.conf
done!