This is the command I run:
composer global require "laravel/installer"
and this is the text and error I got after that:
Changed current directory to /home/dimitar/.composer ./composer.json is not writable.
I'm running Ubuntu 16.04 LTS and PHP 7 and Composer version 1.3.0 and running this command from my home folder.
json. The composer. json file also allows you to give your project a name, version and a few other details, which can be used to publish your own Composer packages to Packagist. Once you're happy with the dependencies you have defined; it's time to install them. Go to your command line and type composer install.
Via Download Once Composer is installed, download the 4.2 version of the Laravel framework and extract its contents into a directory on your server. Next, in the root of your Laravel application, run the php composer. phar install (or composer install ) command to install all of the framework's dependencies.
composer. json is a JSON file placed in the root folder of PHP project. Its purpose is to specify a common project properties, meta data and dependencies, and it is a part of vast array of existing projects.
Check the owner of composer.json.
ls -lh ~/.composer/composer.json
If it's 'root', run:
sudo chown -R yourusername:yourusername ~/.composer/composer.json
While in the .composer folder, check the 'cache' folder owner. If it's 'root', re-run above command but switch composer.json to the cache. Otherwise, you may end up with a 'Cannot create cache directory' warning.
The error says it all, there is a problem with permissions. I guess easiest way to fix this is running this command:
sudo chmod -R 775 /home/dimitar
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With