You can use ref="https://forum.tuteehub.com/tag/s">screen
to open a virtual terminal, where the script can run.
I recommend to use ref="https://forum.tuteehub.com/tag/s">screen -S php_ref="https://forum.tuteehub.com/tag/s">script
. Then you can run your script (even without &). With CTRL + A, D you can disconnect from the termial. You can reconnect with ref="https://forum.tuteehub.com/tag/s">screen -r
back to the terminal.
manpreet
Best Answer
2 years ago
I tried the following command line code to run a php-script in the background.
This works. The problem is: if I close the terminal window on my computer, the php-script also stops. I want it to run "infinite". It's a websocket server so it has to be running constantly.
How can I achieve this?
Thanks in advance!
Edit: I found the answer already (asked this question way to early I guess).