我对这个Websockets真的很新,我正在尝试连接这个websocket:phpwebsocket和WAMP服务器,首先,在我的httpd.conf中我写了听9300,如果我去localhost:9300它工作正常,但是当我去控制台写道:
php -q C:\wamp\www\demos\server.php
Run Code Online (Sandbox Code Playgroud)
我收到了这个错误:

这是server.php的代码:
<?php
set_time_limit(0);
require 'class.PHPWebSocket.php';
function wsOnMessage($clientID, $message, $messageLength, $binary) {
global $Server;
$ip = long2ip( $Server->wsClients[$clientID][6] );
if ($messageLength == 0) {
$Server->wsClose($clientID);
return;
}
if ( sizeof($Server->wsClients) == 1 )
$Server->wsSend($clientID, "There isn't anyone else in the room, but I'll still listen to you. --Your Trusty Server");
else
foreach ( $Server->wsClients as $id => $client )
if ( $id != $clientID )
$Server->wsSend($id, "Visitor $clientID ($ip) said \"$message\"");
}
function wsOnOpen($clientID) …Run Code Online (Sandbox Code Playgroud)