Reputation: 1
The problem behind the laravel installation in ubuntu 18.04
[ErrorException]
file_put_contents(./composer.json): failed to open stream: Permission denied
Upvotes: 0
Views: 1531
Reputation: 5682
As the error specify you do not have permission.
To resolve this error execute this command
sudo chown -R $USER ~/.composer
You may also need to remove the .composer
file from the current directory, to do this open up a terminal window and type this command
sudo rm -rf .composer
OR
If that does not work then try to change the permission of composer.lock
file
sudo chown -R $USER composer.lock
OR
Check the directory you are working in
Upvotes: 0
Reputation: 15316
To resolve this, you should open up a terminal and type this command:
sudo chown -R user ~/.composer
with the user being your current user, in your case, dilip34
After you have ran this command, you should have permission to run your composer global require command.
Upvotes: 0