Skip to content
Advertisement

How to Keep a Ratchet WebSocket alive?

I have a Ratchet (PHP Real-Time Class) project on my localhost. When I want to use and test this project,
I run CMD and use this command: C:wampwwwChatApp> php cmd.php (cmd.php is websocket launcher). and when i press Ctrl + C or exit cmd, this websocket dies.

but, what can i do when i transfer project to main host to alive this websocket?

cmd.php:

JavaScript

Chat.php (Class):

JavaScript

Advertisement

Answer

You can use ( nohup ) command in linux . Write this code in your server.php root

nohup php server.php

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement