lmdat / quiz-app-laravel

Quiz app with Laravel
0 stars 0 forks source link

I can't run the php artisan serve #1

Open hoangbienit opened 5 years ago

hoangbienit commented 5 years ago

Hi friends, I have an error when I run the php artisan serve . Please help me how to run success?

ErrorException : chdir(): No such file or directory (errno 2)

at E:\wamp\www\quiz-app-laravel\framework\vendor\laravel\framework\src\Illumin ate\Foundation\Console\ServeCommand.php:35 31| @throws \Exception 32| / 33| public function handle() 34| {

35| chdir(public_path()); 36| 37| $this->line("Laravel development server started: http://{$this- host()}:{$this-port()}>"); 38| 39| passthru($this->serverCommand(), $status);

Exception trace:

1 chdir("E:\wamp\www\quiz-app-laravel\framework\public") E:\wamp\www\quiz-app-laravel\framework\vendor\laravel\framework\src\Illumi nate\Foundation\Console\ServeCommand.php:35

2 Illuminate\Foundation\Console\ServeCommand::handle() E:\wamp\www\quiz-app-laravel\framework\vendor\laravel\framework\src\Illumi nate\Container\BoundMethod.php:29

Please use the argument -v to see more details.

lmdat commented 5 years ago

Because I moved all files in the default public folder to the root application. So, please try redefine the public_path by the following: Atfer the line in the index.php (in the root folder): $app = require_once DIR.'/framework/bootstrap/app.php';

adding three lines: $app->bind('path.public', function() { return DIR; });

Regards,