根据官方文档使用--daemon可让队列常驻运行。对应命令行执行php artisan queue:work --daemon

但是当前命令还是会因为使用Ctrl+C。将进程给关闭。如何常驻在后台执行?

官方文档还让你安装 supervisor 你为什么不安装呢?

用 supervisor 可以常驻后台,并且监控 php artisan queue:work --daemon 的运行

这样即使重启,都可以稳定的运行队列。

安装教程:https://www.load-page.com/bas...

方法:2

##后台运行队列监听

nohup php artisan queue:listen >/dev/null 2>&1 & 
nohup php artisan queue:work --daemon >/dev/null 2>&1 & //不重新加载整个框架,而是直接 fire 动作
su apache -c -l "nohup php artisan queue:work --daemon >/dev/null 2>&1 &" //以apache用户运行
sudo -u apache -s nohupphp  artisan queue:listen --queue=wxmsg > /dev/null 2>&1 &

相关文章:

  • 2021-11-04
  • 2021-09-09
  • 2021-08-20
  • 2021-08-05
  • 2021-09-07
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-25
  • 2022-01-20
  • 2022-01-07
  • 2022-02-12
相关资源
相似解决方案