问题
I am getting started with the Slim framework. I have downloaded the Slim Framework 4 Skeleton Application which contains the following routes:
$app->options('/{routes:.+}', function (Request $request, Response $response) {
// CORS Pre-Flight OPTIONS Request Handler
return $response;
});
$app->get('/', function (Request $request, Response $response) {
$response->getBody()->write('Hello world!');
return $response;
});
$app->group('/users', function (Group $group) {
$group->get('', ListUsersAction::class);
$group->get('/{id}', ViewUserAction::class);
});
Then according to the Readme.md file, I have launched the app by running this cmd command:
When I type
localhost/8080
I get this error:
Warning: require(C:\xampp\htdocs\phpSlimHttpServer\public/../vendor/autoload.php): failed to open stream: No such file or directory in C:\xampp\htdocs\phpSlimHttpServer\public\index.php on line 11
Fatal error: require(): Failed opening required 'C:\xampp\htdocs\phpSlimHttpServer\public/../vendor/autoload.php' (include_path='C:\xampp\php\PEAR') in C:\xampp\htdocs\phpSlimHttpServer\public\index.php on line 11
Knowing that I haven't changed anything in their official github repo code and followed their instructions, I cannot see why the app didn't work.
来源:https://stackoverflow.com/questions/59731117/warning-requirec-xampp-htdocs-phpslimhttpserver-public-vendor-autoload-php