How to solve php artisan key generate error? - laravel

I created a new Laravel 5.5 project with this command:
laravel new crud-angular
After then, run this command inside the project folder:
php artisan key:generate
At that moment, I got such error:
Warning: require(F:\Study\Laravel\crud-angular/vendor/autoload.php):
failed to open stream: No such file or directory in
F:\Study\Laravel\crud-angular\artisan on line 18
Fatal error: require(): Failed opening required
'F:\Study\Laravel\crud-angular/vendor/autoload.php'
(include_path='.;C:\php\pear') in
F:\Study\Laravel\crud-angular\artisan on line 18
I used wampserver 3.0.6 for this project.
Hope to help me.
Thanks

Make sure you have run:
composer install
Now it seems packages are not installed. If they are, try running:
composer dump-autoload

Try to to give permission for that vendor folder
sudo chmod -R 777 vendor
update your composer also
composer update
this will fix your issue

Most likely you forgot to Install composer just run composer install

Related

deploying laravel into Nginx getting error "failed to open stream: No such file or directory"

I have a problem with deploying laravel into my Nginx. I deployed my laravel app thru github.com
but when I execute php artisan config:cache or php artisan make:auth
This is the error I get:
PHP Warning:
require(/var/www/gafsolutions.com/html/laravel/vendor/autoload.php):
failed to open stream: No such file or directory in
/var/www/gafsolutions.com/html/laravel/artisan on line 18 PHP Fatal
error: require(): Failed opening required
'/var/www/gafsolutions.com/html/laravel/vendor/autoload.php'
(include_path='.:/usr/share/php') in
/var/www/gafsolutions.com/html/laravel/artisan on line 18
First, make sure you have set up a composer properly composer install It will just install all the dependencies as specified in the composer.lock file
If you have already installed then run this command:composer dump-autoload It will clean up all compiled files and their paths.
After, run this command: composer update --no-scripts It will Skips execution of scripts defined in composer.json file.
Then run this command: composer update It will update your depencencies as they are specified in composer.json

file_put_contents(/homepages/storage/framework/views/c8d540ced881ee3d14baa6e1259a7deab143b7fa.php): failed to open stream: No such file or directory

I have a Laravel 5 project that I copied from my friend with FTP to work on it in locally. I ran composer install to install the vendor.
The server is up, but when I enter localhost:8000, it shows me this error:
file_put_contents(/homepages/17/d595652778/htdocs/oneQ/storage/framework/views/c8d540ced881ee3d14baa6e1259a7deab143b7fa.php): failed to open stream: No such file or directory
try this code
php artisan config:cache
It hasn't worked for me:
php artisan config:cache
However this one has worked:
php artisan view:cache
in my case i try to file config.php "delete file bootstrap/cahce/config.php" and its working.
I had a similar issue and i managed to fix it by running:
composer install
from within the project directory or the container if you a using Docker-based development tool such as ddev.

Laravel Artisan not working at all after clone

I have this weird situation: I've cloned all my repositories from github in a new local machine running Mac OsX some of them has Laravel framework installed but only some of these can execute the cmd php artisan.
I've tried to check permission on folders, uninstall/re-install composer and I've also tried to install a fresh version of Laravel. Another problem is that running the command doesn't output anything - no errors, nothing - only a new empty line of the terminal.
The only thing I know is that if I clone one of the repositories, then run composer install it throws Script php artisan optimize handling the post-install-cmd event returned with error code 255.
Thanks
Update 1:
I've found running composer install -vvv -o that composer throw this error
Warning: require(/Users/USERNAME/laravel/bootstrap/autoload.php): failed to open stream: No such file or directory in /Users/USERNAME/laravel/artisan on line 16
Fatal error: require(): Failed opening required '/Users/USERNAME/laravel/bootstrap/autoload.php' (include_path='.:') in /Users/USERNAME/laravel/artisan on line 16
Update 2:
It seems that cmd git clone didn't copy that autoload file bootstrap/autoload.php for some reason that I don't understand at all.
I've imported the file manually from github and run, removed the vendor folder then run again composer install --no-scripts but still having the problem with artisan and if I run composer update it throw Script php artisan optimize handling the post-update-cmd event returned with error code 255
I had to re-install laravel and copy files manually to make it works again.

Class 'Illuminate\Foundation\Application' not found in laravel 5.4

I was create latest laravel project using
composer create-project --prefer-dist laravel/laravel test
After when i run php artisan serv then give me error like:
failed to open stream: No such file or directory in
/var/www/html/test/bootstrap/autoload.php on line 17
After i was run composer dumpauto and solved my problem and after i run php artisan serv then still get error as:
Class 'Illuminate\Foundation\Application' not found in
/var/www/html/sample-project/bootstrap/app.php on line 14
Please help me and solve my issue
Thanks in advance
You should try this:
Please run below command:
composer install --no-scripts
In my case it worked removing "vendor" folder and "composer.lock" and then run:
composer install
Watch step wise step in video tutorial for your problem
Expert Suggestion
then after delete your vendor folder and then hit compser install

Laravel - Error while running php artisan - with MAMP PRO

First steps with Laravel 5 on MacOSX running MAMP PRO stack.
php artisan
I got the following error:
[RuntimeException]
Error Output: PHP Warning:
require(/Users/../../bootstrap/../vendor/autoload.php): failed to open
stream: No such file or directory in
/Users/../../bootstrap/autoload.php on line 17
PHP Fatal error: require(): Failed opening required
'/Users/../../bootstrap/../vendor/autoload.php' (include_p
ath='.:/Applications/MAMP/bin/php/php5.6.10/lib/php') in
/Users/../../bootstrap/autoload.php on line 17
It seems to be related with some bootstrap autoload and MAMP php binaries... But this is as far as I can understand this.
Can I have some advices please?
If I run composer update instead, I do get the same Fatal Error.
It seems you have give a wrong path,re install the laravel.
Thank you for your answers.
I had some issues with composer assets plugin. I have:
1) Remove the folder related to the composer assets plugin.
2) Reinstalled.
3) go to the root diretory of my laravel project.
4) run sudo composer install
Runned php artisan and all seems to be working as expected.
Thank you so much for your time.

Resources