2

I use the example for the chat server in ReactPHP. My server listens on port 8080

$socket = new React\Socket\Server(8080, $loop);
$server->listen($socket);

in my local PC. The written code is working correctly but when upload files into my Linux host, nothing works. I wrote a ticket to the support team from my hoster, they said that this is not possible in Linux. Is that correct?

halfer
  • 19,824
  • 17
  • 99
  • 186
hamed hossani
  • 986
  • 2
  • 14
  • 33
  • is it possible,i use port 80 for get request? – hamed hossani Dec 04 '19 at 10:19
  • 2
    It depends on your host. Most shared host companies won't work with this - you can probably set up a listener, and if 8080 is not taken then it might work locally. However they almost certainly will have a firewall, so external connections won't reach your listener. You can't use 80 either, as that will already be in use by Apache. You probably need a VPS account, where you have root access, and can set up whatever public listeners you want. – halfer Dec 04 '19 at 10:23

1 Answers1

5

ReactPHP core team member here. Your run-of-the-mill shared hosting won't be able to host this. You need your own server, VPS, or bare metal, to run ReactPHP as a server because you're dealing with a daemon process. And shared hosting generally doesn't support that.

My suggestion is to get a VPS somewhere and look into Supervisor to keep your process running and restart it when something happens to it. This also requires you to manage your own server with all the firewalling and networking knowledge that comes with it.

halfer
  • 19,824
  • 17
  • 99
  • 186
WyriHaximus
  • 1,000
  • 6
  • 8