PHP Websocket on Bluehost

2020-04-01 00:49发布

问题:

I am trying to setup Websocket based PHP chat application from Chat-Using-WebSocket-and-PHP-Socket on Bluehost on domain XYZ.ABC.com.

I have changed $host to XYZ.ABC.com both in server.php & index.php.

I am not able find a way to invoke & keep server.php alive.

Is any other way to get this done? even switching hosing provider works for me.

回答1:

If you have shell access you need to run the script with

nohup <command> &

It will then run in background and not stop if you leave the shell.

If you don't have SSH access there is no chance in keeping it alive. Look for a cheap vserver or rootserver with SSH access then.