0

I am trying to set up a Yii project in a Vagrant driven VM, but I'm having problems with file permissions. The project has an app/runtime folder, that requires write access, but the site complains, that the folder is not writable.

I used PuPHPet to create the configs, here is a chunk of the config.yaml:

    synced_folder:
        source:
            source: ./
            target: /var/www
            nfs: 'false'
            owner: 'www-data'
            group: 'www-data'
            mount_options:
                - "dmode=775"
                - "fmode=775"
        yiicore:
            source: ../yii/framework
            target: /yii
            nfs: 'false'

So I try to attach the project folder as /var/www, and that part works, but the web application does not have write permission. (and the owner and group is still vagrant: [ls -la] "drwxr-xr-x 1 vagrant vagrant 272 Apr 10 14:14 runtime/" )

I tried different "tutorials" and possible solutions, but without any success:

Params:

  • Host: MacMini (late 2012), OS X Mavericks + VirtualBox 4.3.10
  • Guest: Precise32 (LAMP)
Community
  • 1
  • 1
seniorpreacher
  • 666
  • 2
  • 11
  • 31
  • I have no idea whether you've solved this already but I would first try and move the application to a folder that is not shared. I have run into problems with folders that are being shared with the Host machine because the Provider (probably VirtualBox) has control of the permissions and you won't be able to set them appropriately. Neither will the application because VirtualBox has permission control. Man I hope that helps a little bit. I've run into perm problems myself so just give it a try. – cOp May 21 '14 at 07:02

2 Answers2

0

For Vagrant 1.7.2, change permission like below.

group: sync_group, owner: sync_owner, mount_options: ['dmode=777', 'fmode=776']
Shaolin
  • 2,541
  • 4
  • 30
  • 41
0

I preferred the sshfs solution, it works much better. Host: apt-get update; apt-get install sshfs VM: apt-get update; apt-get install sshfs Host: mkdir share01; sshfs user@192.168.200.10:/home/user ./share01; cd share01 && ls -al

Ulisses
  • 41
  • 5