php - Laravel 8 为 DDEV 开发设置主管 .conf 文件
问题描述
我正在尝试设置主管来处理队列。我很确定这与 .conf 由于 DDEV 而运行的范围有关,但我不是 100% 确定。
这是我现在的.conf
[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/html/artisan queue:work redis
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
user=www-data
numprocs=5
redirect_stderr=true
stdout_logfile=/home/user/app/workers.log
在这个目录中运行/var/www/html
我得到了这个错误:
supervisor: couldn't chdir to /var/www/html: ENOENT
supervisor: child process was not spawned
我尝试过的其他事情
我试过在目录中运行/home/user/app/artisan
,这实际上有点工作。它确实启动了工作人员,但他们没有监听 DDEV 的正确范围原因,它需要位于/var/www/html
我通过 ssh 的目录中ddev ssh
。说到这我也已经尝试将 .conf 更改为
directory=/home/user/app
command=ddev exec php artisan queue:work redis
我收到一个关于它无法识别 ddev 命令的错误,但它从命令行运行良好。
如果需要任何其他信息,请告诉我。
解决方案
Once the configuration file has been created, you may update the Supervisor configuration and start the processes using the following commands:
sudo supervisorctl reread
sudo supervisorctl update
sudo supervisorctl start laravel-worker:*
For more information on Supervisor, Please Check Here - http://supervisord.org/index.html
推荐阅读
- python - 如何将一维 DataFrame 的 n 个最小值设置为特定值?
- fortran - 分配具有自身值的可分配数组
- xamarin - 如何让 shell.searchandler 推送自己的文本?
- python - 对象可以共享其他对象吗?
- bash - 在 bash 中,当匹配字符串时,会删除与该字符串相关的所有内容(几行:上方和下方)。如何?
- android - 打开对话框时禁用与背景的交互
- python - 没有 CNN 的重复模式的图像语义分割
- excel - 通过 TDMExcelAddIn 导入多个 TDM 文件在“导入文件”方法中出现错误
- c# - 如何获取第二级子节点的 XML 值
- wso2 - 如果我尝试在 DEV 环境中部署 CAR,它会起作用,而当我在另一个环境中部署相同的 CAR 文件时,组件会起作用吗?