问题描述
我刚开始使用Laravel和Horizon,所以很抱歉我的问题在那里.
I am just getting started with Laravel and Horizon so I am sorry if my question is a bit out there.
我已经使用Horizon和Redis数据库设置了Laravel.只要我在其中运行 php artisan horizon
命令的情况下打开SSH连接,一切都可以正常工作.一旦我关闭SSH会话,它就会停止工作.
I have setup Laravel with Horizon and a Redis database. Everything works fine as long as I have my SSH connection open with the php artisan horizon
command running in there. As soon as I close the SSH session, it stops working.
我对这些事情不熟悉,所以我想知道会有什么解决方案.我发现有人说你应该做 php artisan horizon&
,但这似乎可以工作几分钟,然后什么也没有.
I am new with these things so I am wondering what solution there would be. I found someone saying you should do php artisan horizon &
but that seems to work for a few minutes and then nothing.
该系统是在Web服务器上设置的,因此也许cronjob可以修复它.但是我对这些事情的经验非常有限.我希望外面有人可以提供帮助.
The system is as setup on a webserver so maybe a cronjob can fix it. But my experience with those things is very limited. I hope someone out there can assist.
推荐答案
https://laravel.com/docs/5.7/horizon#deploying-horizon
Laravel为此建议主管:
Laravel recommends Supervisor for this:
[program:horizon]
process_name=%(program_name)s
command=php /home/forge/app.com/artisan horizon
autostart=true
autorestart=true
user=forge
redirect_stderr=true
stdout_logfile=/home/forge/app.com/horizon.log
这篇关于关闭ssh后Laravel Horizon停止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!