WebSocket with PHP using IIS 8.0 server

1

Good morning.

Next, I downloaded the following project as an example to create a WebSocket:

link

Testing on a machine with Linux operating system and Apache server worked correctly on the part where the server was started with the command php server.php , correctly showing in the Terminal the connections made and the socket with the chat worked correctly except that the connection was soon lost after a few message submissions.

However, when testing on a Windows 8 machine and IIS server, running the php server.php command was not available for the user to verify which requests to the socket were being performed and the socket did not work when connecting, always returns error unknown even with WebSocket installed and active in IIS settings.

How can I make the project with WebSocket work correctly?

When you click Connect in the client.html file even after the command to start the PHP file:

  

WebSocket connection to 'ws: // localhost: 2207 /' failed: Error in connection establishment: net :: ERR_CONNECTION_REFUSED

As I should show in CMD or Terminal:

HowtostayinWindowsCMD:

    
asked by anonymous 03.09.2015 / 14:32

1 answer

0

Resolved.

In the file php.ini I uncommented the following line:

;extension=php_sockets.dll

And I restarted the IIS server and when running the PHP script it started running.

If you do not have the DLL you can download it at the following site:

link

I hope this helps more developers.

    
03.09.2015 / 15:14