Install and configure supervisord on centos 7 to run Laravel queues permanently

后端 未结 3 2274
渐次进展
渐次进展 2020-12-07 17:50

I want to use Laravel queue system in my project and I want to run php artisan queue:work permanently on server\'s background, I did some searches about thi

3条回答
  •  隐瞒了意图╮
    2020-12-07 18:41

    here is how to install and config supervisord on centos 7 to run Laravel queues permanently:

    1. easy_install supervisor
    2. yum install supervisor
    3. vim /etc/supervisord.conf edit section program as following:
    [program:laravel-worker]
    command=php /path/to/app.com/artisan queue:work 
    process_name=%(program_name)s_%(process_num)02d
    numprocs=8 
    priority=999 
    autostart=true
    autorestart=true  
    startsecs=1
    startretries=3
    user=apache
    redirect_stderr=true
    stdout_logfile=/path/to/log/worker.log
    
    1. systemctl enable supervisord to autorun at start
    2. systemctl restart supervisord to restart the service

提交回复
热议问题