I am newbie. Trying to install react php to make a asynchronous server. I installed it using composer require react/react. And then included the autoload.php in the code. But it is not able to autoload the required files. I have written this code
`<?php
require_once '../vendor/autoload.php';
$i = 0;
$app = function ($request, $response) use (&$i) {
$i++;
$text = "This is request number $i.n";
$headers = array('Content-Type' => 'text/plain');
$response->writeHead(200, $headers);
$response->end($text);
};
$loop = ReactEventLoopFactory::create();
$socket = new ReactSocketServer($loop);
$http = new ReactHttpServer($socket);
$http->on('request', $app);
$socket->listen(1337);
$loop->run();
?>
` This is my composer json
{
"require": {
"react/react": "*"
}
}
This is my vendor folder structure
-Vendor
-react
-evenement
-psr
-composer