Hiện tại mình đang dùng MacOS, lỗi này sẽ thường gặp cho anh em nào đang dùng laravel
Setup supervisor để xử lý queue.
Supervisor thì running nhưng queue thì cử ở trạng thái idle không xử lý.
Setup ban đầu của mình
[program:queue-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /Users/tinhnguyen/Sites/laravel/src/artisan queue:work rabbitmq --queue=order_hook_queue
numprocs=8
startsecs=0
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile= /Users/tinhnguyen/Sites/laravel/src/storage/logs/worker.log
Cơ bản thì copy dòng này chạy terminal thì nó vẫn ok
php /Users/tinhnguyen/Sites/laravel/src/artisan queue:work rabbitmq --queue=order_hook_queue
- Nhưng khi worker run thì thường sẽ lỗi bash của php
Cách khắc khục đơn giản là
Ở terminal
tinhnguyen ~ $ which php
/usr/local/opt/php@7.4/bin/php
Sau giờ copy lại bash của php là ok.
[program:queue-worker]
process_name=%(program_name)s_%(process_num)02d
command=/usr/local/opt/php@7.4/bin/php /Users/tinhnguyen/Sites/laravel/src/artisan queue:work rabbitmq --queue=order_hook_queue
numprocs=8
startsecs=0
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile= /Users/tinhnguyen/Sites/laravel/src/storage/logs/worker.log
Note: Đây là cách setup dưới local cho anh em đang dùng macos, còn lên môi trường production có thể khác.
Chúc anh/em cấu hình chạy ngon lành
6 COMMENT
admin
Thứ 4, 11/08 tên miền .FUN giá 1K | .com 188k | .net 169k | .xyz, .online, .website 9k | .vn -100% tặng .shop 0đ
admin
admin
admin
admin
admin