0

I am trying with putty below command and its working

php artisan horizon

But if I close ssh (putty) this command automatically shut down.

I want to run this command always in the background.

UMAIR ALI
  • 1,055
  • 5
  • 14
  • 25

2 Answers2

3

You have some options for run some process in background :

  1. Using & : php artisan horizon &
  2. Using nohup : nohup php artisan horizon (but you don't need this option)
  3. Using systemctl : create a service (but you don't need this option)

in your case the first option is the best.

Amin Paydar
  • 87
  • 1
  • 9
3

Try with & at the end of the command to put the process background.

php artisan horizon &

Pubudu Jayawardana
  • 2,250
  • 1
  • 13
  • 18
  • Can you please guide me about the termination of this command if in future I want to stop this command. – UMAIR ALI Dec 26 '17 at 06:29
  • You can use `fg` to get the last background command into the foreground and `Ctrl+c` to terminate it. – Pubudu Jayawardana Dec 26 '17 at 07:08
  • this command php artisan horizon & working in the background until putty is working but I want this command work always run in the background after I close putty. – UMAIR ALI Dec 26 '17 at 07:12