1

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?

Davina Leong
  • 737
  • 2
  • 11
  • 28
  • Did you find any solution so far? I have the same issue in my case i running with PHP 7.1, but the error is exactly the same. – Abner May 10 '19 at 18:29

2 Answers2

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.

Abner
  • 612
  • 2
  • 9
  • 24
0

Looks like you have a fresh installation of laravel here...or, you just cloned the repo?

If so, the first thing you should do is to try and install the packages that Laravel uses.

Within those packages is a file called "autoload.php" which your server is looking for here.

Now, to do that, simply navigate within your terminal to the directory of your project and run: composer install. Wait for it to finish and then, try to continue from there.

Wale
  • 1,321
  • 16
  • 11