讨论 使用交流 如何使用 MySQL 作为队列驱动

如何使用 MySQL 作为队列驱动

fkenuiabcd 发表于    阅读:301    回复:12

https://modstart.com/doc/tutorial/arch.html#如何使用-mysql-作为队列驱动


② 执行数据库迁移文件  php artisan migrate   这个是在网站的根目执行。

还是在 database/migrations/  这个目录执行的。


评论

在网站的根目录。

 

@ModStart:

进程目录 也是网站根目录吗?


启动命令   /usr/bin/php /www/wwwroot/www.hz102.com/artisan queue:listen database --sleep


 

是的,启动命令参考文档。

 

@ModStart:

[program:queue-worker]

command=/usr/bin/php /www/wwwroot/www.hz102.com/artisan queue:listen database --sleep

directory=/www/wwwroot/www.hz102.com/

autorestart=true

startsecs=3

startretries=3

stdout_logfile=/www/server/panel/plugin/supervisor/log/queue-worker.out.log

stderr_logfile=/www/server/panel/plugin/supervisor/log/queue-worker.err.log

stdout_logfile_maxbytes=2MB

stderr_logfile_maxbytes=2MB

user=www

priority=10

numprocs=1

process_name=%(program_name)s_%(process_num)02d



启动不了的。不知道是什么问题,

 

可以先在 shell 模式下切换到 www 用户,运行这个命令,看有没有报错提示。

 

@ModStart:

  我换成了 root  也是一样启动不了

 

看报错日志是什么,直接找到错误原因排查。

 

检查一下 /usr/bin/php 是哪个PHP版本

 

php 版本不支持的,你安装的哪个系统。可以命令行指定下使用和系统安装相同的php版本。

 

@ModStart:

php8版本删除了,这样就可以吗?

 

请使用指定版本的php运行。

比如安装的是 5.6 的,使用 /www/xxxx/php/56/php 来运行artisan。

如果安装的是 8.1 的,使用 /www/xxxx/php/81/php 来运行artisan。

具体要看php安装的路径是哪个,系统默认的 /bin/php 不知道链接的是哪个版本,需要自行指定一下。


 
1
我来评论
QQ
微信