1

I have just installed Laravel Homestead on my computer running Windows 10 and now I'm trying to create my first project with Composer.

I have cd:ed into the right folder called Code after doing vagrant ssh.

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

returns an error.

[ErrorException] mkdir(): Permission denied

Must be some kind of error with Composer permissions. How can I fix it?

Maraboc
  • 10,550
  • 3
  • 37
  • 48
bödvar
  • 49
  • 1
  • 8
  • Did you install Composer as Administrator? And what is the complete location of the folder? – Rav Nov 18 '16 at 00:10

4 Answers4

0

In Windows 10 if you face some access problems you need to run the consoles and GIT BASH with Administrator rights only

Iefimenko Ievgen
  • 379
  • 1
  • 5
  • 12
0

In the "Homestead.yaml" file you can configure 777 permission via the following configuration. "dmode=777" means all directory gets 777 permission and "fmode=777" means all file gets 777 permission on "code" folder.

folders:   
- map: C:/Users/NEW/code
  to: /home/vagrant/code                                   
  options:                 
      mount_options: ["dmode=777","fmode=777"]  
0

Ensure that the directory you are using is in the xampp folder. The error happens because you do not have write permission on your project folder. Check to ensure you are creating the project on the xampp folder because, regardless of you being the local admin, you may only have read permissions on some folders. You can right-click on the folder>properties>security tab on the users, click Add then add your username and assign them Full Control, click Apply. It may take some time to apply depending on the number of projects you have. After it finishes, you should be good.

PS: This is for Windows users and I sorted this out using the same process.

-3

I solvet it temporarily with a solution that I'm not fully satisfied with, but at least it works.

sudo chmod 777 code-folder-name

Did this in the vagrant root folder.

bödvar
  • 49
  • 1
  • 8
  • You should never use permissions 777. These are open permissions and allow anyone access to the server. I understand that this is in your local machine but it is simply bad practice. Look at this answer for a better approach https://stackoverflow.com/questions/20678360/laravel-blank-white-screen/20682951#20682951 – Iruku Kagika Jul 31 '18 at 08:52