Search code examples
nginxlaravel-5laravel-valetphp-7.3

Laravel & Valet: Failed to open stream


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?


Solution

  • 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.