I created a new Laravel project. When I go to the terminal to install the dependecies composer
displays the following warning:
Cannot create cache directory /home/w3cert/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache.
This question is related to
php
laravel
composer-php
Use this command:
sudo chown -R $USER ~/.composer/
When you installed composer pretty sure you used $ sudo
command because of that the ~/.composer
folder was created by the root.
Run this to fix the issue:
$ sudo chown -R $USER $HOME/.composer
I had the same problem today. Try it!
sudo chown -R [yourgroup] /home/[youruser]/.composer/cache/repo/https---packagist.org/
sudo chown -R [yourgroup] /home/[youruser]/.composer/cache/files/
I had a similar problem recently, and needed to change the permissions of my vendor folder
By running following commands :
php artisan cache:clear
chmod -R 777 storage vendor
composer dump-autoload
I need to give all the permissions required to open and write vendor files to solve this issue
Run this command :
sudo chown -R yourUser /home/yourUser/.composer
Source: Stackoverflow.com