Laravel Horizon stops after I close ssh

1152 views laravel
3

I am just getting started with laravel and horizon so I am sorry if my question is a bit out there.

I have setup laravel with horizon and a redis database. Everything works fine as long as i have my shh connection open with the "php artisan horizon" command running in there. As soon as I close the ssh it stops working.

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.

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.

answered question

1 Answer

1

a fast solution would be to use the screen command if the server os is linux:

  1. ssh into the server.
  2. run screen.
  3. run the command php artisan horizon.
  4. hit Ctrl + a, then d, to detach from the current session, then exit from ssh

posted this

Have an answer?

JD

Please login first before posting an answer.