Muhammad Talha
Muhammad Talha

Reputation: 337

ratchet not working demo

I am working on ratchet php sockets. since i am new in sockets so i follow demo from ratchet after follow the code i got the error

Fatal error: Class 'MyApp\Chat' not found in C:\xampp\htdocs\www\chating\bin\chat-server.php on line 13

I copy all code but i still this error. i am going to paste the code of chat-server.php

<?php

use Ratchet\Server\IoServer;
use Ratchet\Http\HttpServer;
use Ratchet\WebSocket\WsServer;
use MyApp\Chat;

require dirname(__DIR__) . '/vendor/autoload.php';

$server = IoServer::factory(
              new HttpServer(
              new WsServer(
              new Chat()
            )
            ), 8080
);

$server->run();

Upvotes: 1

Views: 514

Answers (1)

Muhammad Talha
Muhammad Talha

Reputation: 337

I got my solution after searching before run command

php bin/chat-server.php

first execute this command

composer dumpautoload

Upvotes: 1

Related Questions