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?

2
  • is it possible,i use port 80 for get request? Commented Dec 4, 2019 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. Commented Dec 4, 2019 at 10:23

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.