Search code examples
laravelphpunitpuppetlaravel-5

Vagrant: executable files are not executable


I installed vagrant box using https://puphpet.com/
The problem is executable files are not executable:

$ ls -la ./vendor/bin/phpunit
-rwxrw-r-- 1 www-data www-data 138 Feb  6 11:07 ./vendor/bin/phpunit*

I looked in my .vagrant\machines\default\virtualbox in project folder and found there: "mount_options":["dmode=775","fmode=764"].

But this file is generated automatically, so changing it is not a good idea. If I change it, it will be changed back.

How can it be fixed?


Solution

  • you may change that with a puppet manifest using the file-type, especially the mode-property

    file {'/project/vendor/bin/phpunit':
      mode => 0777 # read,write,execute for everyone
    }
    

    Make sure the file exists before running this manifest. See more on unix file-modes here: http://ss64.com/bash/chmod.html