israr israr - 1 year ago 204
PHP Question

Ratchet IO Server suddenly stop working

I am using

. I am running it using cron job. My Chat application is working fine. But after sometime
stop working. When I recheck whether the process is running or not, I can see the process is still there, but the
Ratchet server
basically could not be
to anymore.

Here is my code which running server:

$server = IoServer::factory(
new HttpServer(
new WsServer(
new AppServer()

I database connection fails at some point which stops the server. Any possible solution of this?

Answer Source

You can install Supervisord service in your Web Server which actually watch your Rachet Server, If your Rachet Server stopped it will automatically start it again.

You can get Supervisord installation details from here.