Warning: require(C:\xampp\htdocs\phpSlimHttpServer\public/../vendor/autoload.php): failed to open stream [closed]

偶尔善良 提交于 2020-01-16 08:36:36

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!