Laravel & Valet: Failed to open stream

天涯浪子 提交于 2021-01-29 07:30:18

问题


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:

  1. composer -i
  2. sudo chmod 755 -R folder_name
  3. Create the .env file, if is fresh application just copy the content of the .env.example file.
  4. 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

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