0
votes

The problem behind the laravel installation in ubuntu 18.04

[ErrorException]
file_put_contents(./composer.json): failed to open stream: Permission denied

2

2 Answers

0
votes

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.

0
votes

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