Note that there are some explanatory texts on larger screens.

plurals
  1. POError with PHP Websocket and Wamp Server
    text
    copied!<p>I'm really new about this of Websockets, i'm trying to connect this websocket: <a href="https://code.google.com/p/phpwebsocket/" rel="nofollow noreferrer">phpwebsocket</a> with WAMP server, first, in my httpd.conf I wrote listen 9300, and if i go to localhost:9300 it works right, but when I go to console and write:</p> <pre><code> php -q C:\wamp\www\demos\server.php </code></pre> <p>I got this error:</p> <p><img src="https://i.stack.imgur.com/Em4eQ.png" alt="error"></p> <p>Here's the code of server.php:</p> <pre><code>&lt;?php set_time_limit(0); require 'class.PHPWebSocket.php'; function wsOnMessage($clientID, $message, $messageLength, $binary) { global $Server; $ip = long2ip( $Server-&gt;wsClients[$clientID][6] ); if ($messageLength == 0) { $Server-&gt;wsClose($clientID); return; } if ( sizeof($Server-&gt;wsClients) == 1 ) $Server-&gt;wsSend($clientID, "There isn't anyone else in the room, but I'll still listen to you. --Your Trusty Server"); else foreach ( $Server-&gt;wsClients as $id =&gt; $client ) if ( $id != $clientID ) $Server-&gt;wsSend($id, "Visitor $clientID ($ip) said \"$message\""); } function wsOnOpen($clientID) { global $Server; $ip = long2ip( $Server-&gt;wsClients[$clientID][6] ); $Server-&gt;log( "$ip ($clientID) has connected." ); foreach ( $Server-&gt;wsClients as $id =&gt; $client ) if ( $id != $clientID ) $Server-&gt;wsSend($id, "Visitor $clientID ($ip) has joined the room."); } function wsOnClose($clientID, $status) { global $Server; $ip = long2ip( $Server-&gt;wsClients[$clientID][6] ); $Server-&gt;log( "$ip ($clientID) has disconnected." ); foreach ( $Server-&gt;wsClients as $id =&gt; $client ) $Server-&gt;wsSend($id, "Visitor $clientID ($ip) has left the room."); } $Server = new PHPWebSocket(); $Server-&gt;bind('message', 'wsOnMessage'); $Server-&gt;bind('open', 'wsOnOpen'); $Server-&gt;bind('close', 'wsOnClose'); $Server-&gt;wsStartServer('localhost', 9300); ?&gt; </code></pre> <p>Thank you.</p> <p>Oh, And my extensions:</p> <pre><code>;extension=php_bz2.dll extension=php_curl.dll ;extension=php_dba.dll extension=php_mbstring.dll ;extension=php_exif.dll ;extension=php_fileinfo.dll extension=php_gd2.dll ;extension=php_gettext.dll ;extension=php_gmp.dll ;extension=php_intl.dll ;extension=php_imap.dll ;extension=php_interbase.dll ;extension=php_ldap.dll ;extension=php_ming.dll ;extension=php_mssql.dll extension=php_mysql.dll extension=php_mysqli.dll ;extension=php_oci8.dll ;extension=php_oci8_11g.dll extension=php_openssl.dll ;extension=php_pdo_firebird.dll ;extension=php_pdo_mssql.dll extension=php_pdo_mysql.dll ;extension=php_pdo_oci.dll ;extension=php_pdo_odbc.dll ;extension=php_pdo_pgsql.dll extension=php_pdo_sqlite.dll ;extension=php_pgsql.dll ;extension=php_phar.dll ;extension=php_pspell.dll ;extension=php_shmop.dll ;extension=php_snmp.dll ;extension=php_soap.dll extension=php_sockets.dll ;extension=php_sqlite.dll ;extension=php_sqlite3.dll ;extension=php_sybase_ct.dll ;extension=php_tidy.dll ;extension=php_xmlrpc.dll ;extension=php_xsl.dll ;extension=php_zip.dll </code></pre> <p>And also, the output of php -me</p> <p><img src="https://i.stack.imgur.com/9rIsD.jpg" alt="PHP -me"></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload