2

I'm setting up my Laravel environment, having installed composer and laravel. I can't call php artisan

I've tried installing and updating, however I'm still being returned errors.

C:\Users\Pat\personal> php artisan PHP Warning: require(C:\Users\Pat\personal/vendor/autoload.php): failed to open stream: No such file or directory in C:\Users\Pat\personal\artisan on line 18

Warning: require(C:\Users\Pat\personal/vendor/autoload.php): failed to open stream: No such file or directory in C:\Users\Pat\personal\artisan on line 18 PHP Fatal error: require(): Failed opening required 'C:\Users\Pat\personal/vendor/autoload.php' (include_path='C:\xampp\php\PEAR') in C:\Users\Pat\personal\artisan on line 18

Fatal error: require(): Failed opening required 'C:\Users\Pat\personal/vendor/autoload.php' (include_path='C:\xampp\php\PEAR') in C:\Users\Pat\personal\artisan on line 18 PS C:\Users\Pat\personal>

Udhav Sarvaiya
  • 9,380
  • 13
  • 53
  • 64
patrickGold
  • 69
  • 1
  • 7
  • 2
    You should run `php artisan ...` commands **inside** a folder containing a Laravel project. If not, try to [create a project first](https://laravel.com/docs/5.7/installation#installing-laravel) – Kenny Horna Sep 07 '19 at 04:14
  • 1
    Possible duplicate of [Could not open input file: artisan](https://stackoverflow.com/questions/26193314/could-not-open-input-file-artisan) – Kenny Horna Sep 07 '19 at 04:15

3 Answers3

1

the vendor folder is missing so you got this error:

Warning: require(C:\Users\Pat\personal/vendor/autoload.php): failed to open stream: No such file or directory in C:\Users\Pat\personal\artisan on line 18

Run this command in your command prompt:

composer update --no-scripts 
composer update
  • composer update --no-scripts It will Skips execution of scripts defined in composer.json file.
  • composer update It will update your depencencies as they are specified in composer.json file.

With this command, you will re-create the vendor folder in your project

Udhav Sarvaiya
  • 9,380
  • 13
  • 53
  • 64
1

Type on CLI:

composer install

run this command first

composer dump-autoload

source and credits to: require(vendor/autoload.php): failed to open stream on Synchro comment

Two
  • 512
  • 4
  • 17
0

Check there might not vendor folder in your project root. So first run composer install command in the terminal. And it will generate the file that are missing.