Answer the question
In order to leave comments, you need to log in
How to keep the script running after closing the console?
In the console, I enter the command , the php script.php
script starts working, if I close the console or the connection to the network is lost, the script stops.
How to make it work further even if the console is closed? Tried php script.php &
it didn't work...
Answer the question
In order to leave comments, you need to log in
use nohup <your command>
in fact, when the connection is broken, the hup signal is sent to the process (historically, the type picked up the phone, the modem ended).
the nohup program blocks this signal, and in the event of a connection break, it redirects all output that should have gone to the screen (stdout) to the nohup.out file (by default, in the same directory where the script was run)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question