Reputation: 98
I am new to Laravel. I don't why this isn't working.
user@user-MS-7529:~/blog$ php artisan key:generate --ansi
PHP Warning: require(/home/user/blog/vendor/autoload.php): Failed to open stream: No such file or directory in /home/user/blog/artisan on line 18
PHP Fatal error: Uncaught Error: Failed opening required '/home/user/blog/vendor/autoload.php' (include_path='.:/usr/share/php') in /home/user/blog/artisan:18
Stack trace:
#0 {main}
thrown in /home/user/blog/artisan on line 18
Upvotes: 0
Views: 7815
Reputation: 98
Thanks everyone for your precious time the error has now been fixed This caused error because during the time making laravel project it has caused some error in my case php-mbstring and php-xml was not availabe or installed on my system somehow. you can simply fixed it by
sudo apt-get update
sudo apt-get install php-mbstring
or if got the older version
sudo apt-get install php7.2-mbstring
sudo apt install php-xml
And boom your error got fixed!!!Hope this could be useful in future
Upvotes: 1
Reputation: 99
Also if you have pulled the codebase from git then you need to run composer update in your project directory to get all the packages installed in vendor folder.
Upvotes: 0
Reputation: 987
Install Composer ..
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === '756890a4488ce9024fc62c56153228907f1545c228516cbf63f885e036d37e9a59d27d63f46af1d4d07ee0f76181c7d3') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
Make sure you have run:
composer install
Now it seems packages are not installed. If they are, try running:
composer dump-autoload
Then run
composer global update
Try to to give permission for that vendor folder
sudo chmod -R 777 vendor
update your composer also
composer update
Upvotes: 0