【PHP】PHPでWebSocketサーバー - クライアント間の通信 -
以下の記事を参考にWebSocketをサーバーを立てて、docker+FuelPHP上で実行してみました。 http://madroom-project.blogspot.com/2013/04/phpwebsocket.html なお、FuelPHPについてフレームワークとしての機能は使用していませんので、どんなフレームワークを使っても同じ方法で行けると思います。 ライブラリのインストール composer.json の require に以下を追加 "cboden/Ratchet": "0.2.*" 以下コマンドでインストール $ ./composer.phar update --lock Loading composer repositories with package information Updating dependencies (including require-dev) Package operations: 1 install, 0 updates, 0 removals - Installing textalk/websocket (1.0.3): Loading from cache Package guzzle/common is abandoned, you should avoid using it. Use guzzle/guzzle instead. Package guzzle/http is abandoned, you should avoid using it. Use guzzle/guzzle instead. Package guzzle/parser is abandoned, you should avoid using it. Use guzzle/guzzle instead. Package guzzle/stream is abandoned, you should avoid using it. Use guzzle/guzzle instead. Writing lock file Generating autoload files 実装 WebSocketサーバー側 以下をプロジェクトの適当なディレクトリに配置します。(requ