简体   繁体   中英

Why json permission is denied in the user of the linux

The problem behind the laravel installation in ubuntu 18.04

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

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM