Pregunta

I need to make a TCP/IP socket server in PHP. So I downloaded an example from php.net and tried it on my own machine (changed default script socket ip to 127.0.0.1). I opened it from web-browser (because I use XAMMP system, so I can't do a background working shell script), connected to 127.0.0.1:8175 by Telnet and it worked fine! But now I have a problem:

I uploaded that script to remote server, opened port 8175 on the router and could not connect to the remote port from my computer. But I still can connect to the web and ssh ports on that server. Any ideas?

If I asked that question in a wrong place, just say it. And... Sorry for my bad English.

¿Fue útil?

Solución

If you set socket default IP to 127.0.0.1 you will be able to connect only from the machine running the script. So you need to change it something like your server's IP or 0.0.0.0 to accept all connections but take care of security measures.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top