问题
I'm trying to setup a Laravel project on Valet.
I'm getting this error:
Warning: require(/Users/davina/Developer/learn-laravel-graphql/public/../vendor/autoload.php): failed to open stream: No such file or directory in /Users/davina/Developer/learn-laravel-graphql/public/index.php on line 24
Fatal error: require(): Failed opening required '/Users/davina/Developer/learn-laravel-graphql/public/../vendor/autoload.php' (include_path='.:/usr/local/Cellar/php/7.3.1/share/php/pear') in /Users/davina/Developer/learn-laravel-graphql/public/index.php on line 24
Trying to link either the project root or /public
folders results in the above error instead of Laravel's default welcome screen.
How do I resolve this?
回答1:
Try to navigate to the project folder root and run the command:
- composer -i
- sudo chmod 755 -R folder_name
- Create the .env file, if is fresh application just copy the content of the .env.example file.
- inside the project folder again: php artisan key:generate
After those steps all up and running for me :)
Solves the issue for me.
来源:https://stackoverflow.com/questions/55478933/laravel-valet-failed-to-open-stream