So I'm new to Laravel and been following the Laracasts series on Laravel.
I cloned an open source Laravel Project, It doesn't have 'Vendor' Directory' , I was told to run 'composer update' in the root of the project to include it.
I do that and I get the error:
[ErrorException]
copy(/home/sanyam/.composer/cache/files/laravel/socialite/fc3ff90cae77020dba2dc23168bebe2313c43051.zip): failed to open stream: Permission denied
I tried to run the website locally and the terminal gave the error:
Class 'Laravel\Socialite\SocialiteServiceProvider' not found in /home/sanyam/projectname-web/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php on line 150
Here is the deal, I can't edit any code in congif/app.php or anywhere because the project is up and running.
The last time it happened, I was missing the curl extension in PHP, installed it and it worked. This time I've tried clearing the cache using composer dump-autoload (doesn't work)
What am I supposed to do ?
Thank you in advance :)
Related
I am trying to create new Laravel application.
I have installed XAMPP and Composer.
With Composer ( composer global require laravel/installer ) I have installed Laravel.
But when I try to use laravel new firstProject command to create new command the instalation throws two errors.
I am using Windows 10 if that helps.
[RuntimeException]
The archive may contain identical file names with different capitalization (which fails on case insensitive filesys
tems): ZipArchive::extractTo(C:\Users\User1\Desktop\PHP/vendor/composer/374ddf59/laravel-laravel-8e55104\public/rob
ots.txt): Failed to open stream: Permission denied
[ErrorException]
ZipArchive::extractTo(C:\Users\User1\Desktop\PHP/vendor/composer/374ddf59/laravel-laravel-8e55104\public/robots.txt
): Failed to open stream: Permission denied
I have tried:
Reinstalling and updating composer
Reinstalling and updating Laravel
Changing folder where I want to create my project
Using the composer create-project laravel/laravel blog command to create new project through composer still the same errors as above
Read with understanding:
Failed to open stream: Permission denied.
This means that your command line have no access to read or write in current directory. You have to change directory permissions and it should work.
change permissions on windows
change permissions on mac
I had the same problem (Win10).
In my case, my antivirus (Avast) was denying access to composer, but I did not know because I had set Avast to silent mode, so it just denied permission without asking me.
Also, Avast quaranteened an important server.php file so artisan server would stop as soon as I tried loading a page. So I had to restore and allow that file too.
i have the solution.
You only need delete in c:\program file\7-Zip,
after you need, reinstall this software. 7-zip, You need download this software of webpage author.
after execute
laravel new your_app
and ready.
Guys i am frustrated now, I just installed XAMPP yesterday. And I created a folder named "MyProgram" and there is one PHP file inside and basically its just a "Hello World" program. It works fine in the apache localhost.
And now when I created another new folder "MyAPI", I am trying to build another PHP thing with Vimeo API. But this time, no matter how many times I tried, I cant open my "MyAPI" folder on the localhost anymore. Usually when we open in the localhost, there will be a menu for us to choose what file to be opened, but im not sure why this is not working in this case. These are the error message:
Warning: require(vendor/autoload.php): failed to open stream: No such file or directory in D:\XAMPP\htdocs\MyAPI\index.php on line 9
Fatal error: require(): Failed opening required 'vendor/autoload.php' (include_path='D:\XAMPP\php\PEAR') in D:\XAMPP\htdocs\MyAPI\index.php on line 9
And FYI, this my folder:
And this is how I installed my composer:
You need to install your project dependencies first.
Open your terminal
Navigate to your project directory:
cd D:\XAMPP\htdocs\MyAPI\
Run composer install
try to run :
composer install
composer update --no-scripts
If you get the same error also when you run them
Just run this command first
composer dump-autoload
also make sure you run these commands inside the project folder
I'm developping an app under windows 10 + wamp + php 7 + Symfony 3.3
I'm trying to use the built-in server :
php bin/console server:run
[OK] Server listening on http://127.0.0.1:8000
// Quit the server with CONTROL-C.
And when I go to http://localhost:8000/app_dev.php/ or http://127.0.0.1:8000/app_dev.php
I get this error :
Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
Fatal error: Unknown: Failed opening required 'C:\wamp\www\myproject\vendor\symfony\symfony\src\Symfony\Bundle\WebServerBundle/Resources/router.php' (include_path='.;C:\php\pear') in Unknown on line 0
Same error under every routes. My routes are correct and works fine outside of the built-in server...
Can you help me with this issue please ?
I had same problem,
Solved by :
Delete symfony folder in vendor
composer update
If you have antivirus (like Avast) disable it before launching web
server
php bin/console server:run
I got the same error, even when installing via composer.
It turns out that for whatever reason when composer downloaded the project, the required file listed in the error you get (vendor\symfony\symfony\src\Symfony\Bundle\WebServerBundle/Resources/router.php) was not included...
To fix this, I manually added it from https://github.com/symfony/web-server-bundle/blob/master/Resources/router.php and then my symfony app worked as expected.
I had to restart my computer in order to actually add the file because somehow I was locked out of adding it even as admin in Windows after launching the php server.
UPDATE:
Even better than manually adding the file, I just deleted the symfony folder from the vendor folder in the project and reran composer update. the router.php file is indeed downloaded. Sometimes when running bin/console server:run it gets deleted. Not sure why.
It happened to me when upgrading from Symfony 3.1 to Symfony 3.4.
The reason was that I had left the development server running when I executed the command:
composer update
The solution:
Delete the contents of vendor folder
Execute composer update
Install the new Symfony development server bundle (follow the instructions)
Execute the server for development in a new port
php bin/console server:start localhost:3421
I had this problem too : it was AVAST that blocked the "router.php" file.
I went into avast -> protection -> quarantine, and put an exception of the router.php file
And then everything worked again
I get the same error and I solve this issue by installing the project with composer
composer create-project symfony/framework-standard-edition my_project_name
I am new in Laravel and I have the following problem.
I developed a Laravel 5 project on an old computer, and I put the code on a GIT repository. I retrieved my source code on my new laptop from the repository.
But I am facing problems while running the Laravel project on Apache and I am obtaining this error message on my Laravel website instead:
Warning: require(C:\xampp\htdocs\HotelRegistration\bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in C:\xampp\htdocs\HotelRegistration\bootstrap\autoload.php on line 17
Fatal error: require(): Failed opening required 'C:\xampp\htdocs\HotelRegistration\bootstrap/../vendor/autoload.php' (include_path='C:\xampp\php\PEAR') in C:\xampp\htdocs\HotelRegistration\bootstrap\autoload.php on line 17
The C:\xampp\htdocs\HotelRegistration\bootstrap\autoload.php is present in my project
Why am I facing this issue? What is the problem? What am I missing? How can I fix this issue? How can I try to solve this issue?
You need to run
composer install
command to install packages. By default vendor directory is ignored when committing to GIT (this is good) so if you pull data from repository you need to install all packages running above command.
I'm stuck on a very basic problem:
I'm trying to use Laravel, which I installed on my windows 7 with composer.
When I try to access my website locally with Wamp, I get the error:
Warning:
require(C:\wamp\www\sitedirectory\public\protected\bootstrap/../vendor/autoload.php):
failed to open stream: No such file or directory in
C:\wamp\www\sitedirectory\public\protected\bootstrap\autoload.php on
line 17
Everywhere I can read that all I have to do is run composer install or update.
The problem is that I did run both and nothing has to be updated.
The files are where they are needed so I dont understand what could be the problem.
Does anyone have an idea of what could be my problem?
Thank you in advance.
Composer is a tool for managing and installing dependencies.
There should exist a file named composer.phar in the directory C:\wamp\www\sitedirectory\public\protected\. There you should execute the command composer.phar install (on the command line).
Then, the directory vendor containing the autoload.php etc. should be generated.
If the composer.phar does not exist (but at least a file named composer.json), follow the steps explained here to download composer.