How to fix Error: mkdir(): Permission denied when running composer in Laravel project creation

 So many People are stuck with Terminal on linux stystem and they are trying to access the laravel make folder but when then put the command the output will come access denied or permission denied to create a folder in /var/www/html/    in this location lieke the following image 


Solution For this :

1. Change directories


cd /var/www/


2. Change group ownership


sudo chown -Rv root:$USER .


3. Add priviledges to our group


sudo chmod -Rv g+rw .


Put Above code as it is 


For the grand finale, go ahead and create your new laravel project


composer create-project laravel/laravelprojectName--prefer-dist

No comments: