I get this error when I run the php artisan serve command to launch laravel am a beginner in laravel
PHP Warning: require(/home/matynjr/events/vendor/autoload.php): failed to open stream: No such file or directory in /home/matynjr/events/artisan on line 18
PHP Fatal error: require(): Failed opening required '/home/matynjr/events/vendor/autoload.php' (include_path='.:/usr/share/php') in /home/matynjr/events/artisan on line 18
run in your project root folder cmd with composer update command
You need to go to your project room and install dependencies. It says that there is no vendor folder. Vendor folder is a part of composer. It holds dependency files inside.
Run composer install in the project root. It is a good idea to run composer update after that.
If composer install / composer update isn't working for you, try:
composer install --ignore-platform-reqs
OR
composer update --ignore-platform-reqs
After this you should be able to run "php artisan serve".
For faster results you can use
composer update --verbose --prefer-dist
on your root folder run cmd by replacing root directory with cmd
or open new terminal, navigate to your project root folder and follow the steps below
1 run composer install
2 composer update
3 restart your app
4 then run php artisan serve
run composer install in the root directory of your project
In my case, there were some issues in composer.
I resolved it by running this command in cmd in project's root folder:
composer update
In my case, the error emerged because at some point I enter this two commands php "php artisan cache:clear" and "php artisan config:cache".
So, the way a solved my problem was:
Type first "php artisan cache:clear"
php artisan config:cache
npm update
composer update
and that's it.
Related
I want to create new laravel project by composer. I use composer create-project laravel/laravel new-project command for create new project. then, my project is created following this picture.
I start Laravel's local development server using the Laravel's Artisan CLI serve command (first cd new-project and then php artisan serve command). But I got the following error.
Why is there no vendor folder in this project?!!!
How do I fix this error?
(I used PHP 8.1.10)
You need to issue composer install to install packages which creates the vendor/ folder
I get this error when I run the php artisan serve command to launch laravel am a beginner in laravel
PHP Warning: require(/home/matynjr/events/vendor/autoload.php): failed to open stream: No such file or directory in /home/matynjr/events/artisan on line 18
PHP Fatal error: require(): Failed opening required '/home/matynjr/events/vendor/autoload.php' (include_path='.:/usr/share/php') in /home/matynjr/events/artisan on line 18
run in your project root folder cmd with composer update command
You need to go to your project room and install dependencies. It says that there is no vendor folder. Vendor folder is a part of composer. It holds dependency files inside.
Run composer install in the project root. It is a good idea to run composer update after that.
If composer install / composer update isn't working for you, try:
composer install --ignore-platform-reqs
OR
composer update --ignore-platform-reqs
After this you should be able to run "php artisan serve".
For faster results you can use
composer update --verbose --prefer-dist
on your root folder run cmd by replacing root directory with cmd
or open new terminal, navigate to your project root folder and follow the steps below
1 run composer install
2 composer update
3 restart your app
4 then run php artisan serve
run composer install in the root directory of your project
In my case, there were some issues in composer.
I resolved it by running this command in cmd in project's root folder:
composer update
In my case, the error emerged because at some point I enter this two commands php "php artisan cache:clear" and "php artisan config:cache".
So, the way a solved my problem was:
Type first "php artisan cache:clear"
php artisan config:cache
npm update
composer update
and that's it.
After composer update I got an error:
In Filesystem.php line 146:
rename(/var/www/bootstrap/cache/packages.phpE7r5E4,/var/www/bootstrap/cache
/packages.php): No such file or directory
Artisan commands don't work anymore. Already tried:
composer du
composer install
composer update
I found the problem, my windows docker (version 2.1.0.3) sometimes fails to execute. I don't know how it looks like the packages.php file just got locked. So here is the recipe to fix:
I restarted windows,
deleted all the files inside bootstrap\cache
started the containers
run artisan optimize
run composer du
Everything went back to work like a magic. :)
run this command: composer dump-autoload This command will clean up all compiled files and their paths.
enter this command in your terminal for clear cache: php artisan cache:clear
For me deleting the composer.lock file and then running composer install fixed the issue.
I had the same error and these commands helped me:
1. composer dump-autoload
2. php artisan cache:clear
3. php artisan optimize:clear
Try:
composer dump-autoload
or:
artisan cache:clear
after you update or make changes to composer.json to refresh everything.
I'm working on a laravel project with my android phone.
I cleared junk files on the phone using a software and now I get error when trying to serve the laravel project.
First, I ran php artisan serve and got this error:
$ php artisan serve
In PackageManifest.php line 168:
The /storage/emulated/0/web/tbcians/bootstrap
/cache directory must be present and writable
.
Then I created the cache directory and ran php artisan serve again and got another error:
$ php artisan serve
In ProviderRepository.php line 208:
Class 'Illuminate\Cache\CacheServiceProvider'
not found
How do I fix this?
I've tried running
$ composer update
and
$ composer update --no-scripts
but I'm still getting the error
This solved the problem:
Remove "vendor" directory. Use "rm -rf vendor" if you in terminal
Remove composer.local file from root
Run "composer install"
– Jickson Johnson Koottala
First clear your cache.php artisan cache:clear. Then composer update
After familiar with Codeigniter, I stared to learn Laravel.
I able to install Laravel using following command.
composer create-project --prefer-dist laravel/laravel blog
It works fine. :-)
Next I tried to setup sample Laravel project. I found a sample project from here (https://github.com/evercode1/sample-project).
What I did is I just download it and copied all folders to Xampp htdocs folder.
Then I visit the "http://localhost/sample-project-master/public/".
It gives following error.
Warning:
require(D:\xampp\htdocs\sample-project-master\bootstrap/../vendor/autoload.php):
failed to open stream: No such file or directory in
D:\xampp\htdocs\sample-project-master\bootstrap\autoload.php on line
17
Fatal error: require(): Failed opening required
'D:\xampp\htdocs\sample-project-master\bootstrap/../vendor/autoload.php'
(include_path='D:\xampp\php\PEAR') in
D:\xampp\htdocs\sample-project-master\bootstrap\autoload.php on line
17
Have I done mistake when setting up already available Laravel project? How I correct following errors or what is the way to import Laravel project?
You should do:
1) Install composer dependencies
composer install
2) An application key need to be generated with the command
php artisan key:generate
3) Open Project in a Code Editor, rename .env.example to .env and modify DB name, username, password to your environment.
4) Migrate the database along with seed
php artisan migrate --seed
5) Now run the artisan serve command
php artisan serve
the first error is due to not getting file path for bootstrap in bootstrap folder .
you should run: composer install
3 . laravel requires vendor libraries which needs to be install , it does not come automatic with the package . because it's is git ignored . so you need to install it if needed.
You should try this
composer install
OR
composer update --no-scripts
composer update
For more details please follow this link.
This means some dependencies are messing,
Open your project root folder and run this command:
composer install
or
php composer.phar install
I believe below command should work as I have tested on Windows and Linux:
composer update --no-scripts
or if you already installed and updated the composer then check below command:
composer global update
first You have to move the project to www(folder) or htdocs if using xamp or any folder that apache load the files from
then open ur terminal or cmd , and cd untill u reach prject folder , or u can do
shift + right click in the folder , a menu will come up choose "open command window here" .
then write this command composer update this will install all the packages u need to run the project .
dont forget to modify .env file with your database information .
this should work .
You are facing this issue because your system might not have composer.laravel need dependency manager.you have to install the first composer to your htdoc folder.
You can install composer using following this command,composer installNow you can install laravel using (must run this command inside your htdoc)composer global require "laravel/installer"
Now you can create project usinglaravel new YOUR_PROJECT_NAME
OR
composer create-project --prefer-dist laravel/laravel YOUR_PROJECT_NAME
Note : it is good if you install composer and laravel on global location.
Documentation Available Here : https://laravel.com/docs/5.4/installation