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
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)
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
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
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
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.