'Class 'Ratchet\Server\IoServer' not found
I am following the tutorial here: http://socketo.me/docs/hello-world.
I am trying to get this tutorial application (using Laravel 5) to work but I am getting this error when I try to run the chat-server.php script:
Fatal error: Class 'Ratchet\Server\IoServer' not found in C:\Users\riyazs\projectname\app\Console\Commands\chat-server.php on line 7
projectname/app/Console/Commands/chat-server.php:
<?php
use Ratchet\Server\IoServer;
use App\Chat;
$server = IoServer::factory(
new Chat(),
8080
);
$server->run();
projectname/app/Chat.php:
<?php
namespace App;
use Ratchet\MessageComponentInterface;
use Ratchet\ConnectionInterface;
class Chat implements MessageComponentInterface {
public function onOpen(ConnectionInterface $conn) {
}
public function onMessage(ConnectionInterface $from, $msg) {
}
public function onClose(ConnectionInterface $conn) {
}
public function onError(ConnectionInterface $conn, \Exception $e) {
}
}
autoload part of composer.json
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
Solution 1:[1]
Missing:
require /vendor/autoload.php in chat-server.php;
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
