Socket_create

Username epiz_27513222

Error Message

Fatal error : Uncaught Error: Call to undefined function socket_create() in /home/vol1000_6/epizy.com/epiz_27513222/htdocs/server.php:14 Stack trace: #0 {main} thrown in /home/vol1000_6/epizy.com/epiz_27513222/htdocs/server.php on line 14

Other Information

I’m trying to use socket

6 Likes

In which is limited?
I tried the following:
http://npmgiochi.rf.gd/server.php (with
$host = “127.0.0.1”;
$port = 8081;
$socket = fsockopen($host, $port, $errno, $errstr, 30):wink:
receiving
Warning : fsockopen(): unable to connect to 127.0.0.1:8081 (Connection refused) in /home/vol1000_6/epizy.com/epiz_27513222/htdocs/server.php on line 14

Tks

What is port 8081 used for?

to quote from my previous…

Additional ports cannot be opened on request.

Ok, this was the port I used to access the xampp server on my PC.
Excuse me, but I don’t know which port to use.
Cantone you send me a little working example on socket connection through my infinity server?
Thanks a lot

What are you trying to connect to even?

The code is fine, but our web servers don’t run anything on port 8081.

3 Likes

Ok,
maybe I misandertood something. Anyway this is what I want to do:
A client-server communication on socket. The client is an html request, the server is server.php that I did upload on infinity, and in wich there is the fsockopen call. So my intention was to have a php server (server.php) waiting for socket connections, but surely I’m missing something. Cantone you help me?
Thanks a lot

And for what are you using websockets? even if you can get it to work it’ll reach your daily limits so fast.

3 Likes

Oh, I think I get it, you’re trying to setup a listening socket on the server?

We do support client sockets on our hosting (which connect from your PHP code to external systems) but not server sockets (which runs a process to listen for incoming connections from other systems)

I’m sorry, but that’s just not going to work with any web hosting service. You’d have to run a persistent background process to listen to the socket and make it available from the web. No web hosting provider I know allows or supports this.

You need your own (virtual) server for these kinds of applications.

4 Likes

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.