title: Laravel - keep getting log & framework data cache errors
body: <p>I am using Laravel 6.x inside a Homestead environment and have recently come up with some weird errors when I attempt to login via an Angular frontend - once it hits the login endpoint it gives me some strange errors (see below</p>
  <pre><code>The stream or file &quot;/home/vagrant/code/abc-backend/storage/logs/laravel-2020-07-23.log&quot; could not be opened: failed to open stream: Permission denied
  </code></pre>
  <p>The file above doesn't exist for some reason (other log files for other dates exist but not the one from the 23rd July). I have then manually created the file as follows &amp; chmod'd it to 777:</p>
  <pre><code>touch storage/logs/laravel-2020-07-23.log
  chmod 777 storage/logs/laravel-2020-07-23.log
  </code></pre>
  <p>When I reload the page the previous error has gone but I now get the following error instead :</p>
  <pre><code>file_put_contents(/home/vagrant/code/abc-backend/storage/framework/cache/data/1c/6e/1c6ea8378a1030f85a05f4cb2262de1e2164efa6): failed to open stream: No such file or directory&quot;,
  </code></pre>
  <p>I have also tried the following with no joy:</p>
  <p><code>chown -R vagrant:www-data /home/vagrant/code/abc-backend/storage</code></p>
  <p><code>chmod -R g+w /home/vagrant/code/abc-backend/storage</code></p>
  <p>I have tried lots of things with <code>php artisan</code> to try to remedy these errors including running
  <code>php artisan cache:clear</code> commands with no joy - can anyone else give me an insight into why I am getting both the log file error and the cache/data error &amp; the best methods to fix them both?</p>
  <p>Let me know if you need any more info with my setup that will assist.</p>
  <p>-- Update --
  I am using Virtual Box 6.0 the Homestead box runs Ubuntu 18.04.3 LTS
  Homestead v10.9.1</p>
  <p>Homestead.yaml file --</p>
  <pre><code>---
  ip: &quot;192.168.10.10&quot;
  memory: 2048
  cpus: 2
  provider: virtualbox
  authorize: ~/.ssh/id_rsa.pub
  
  keys:
      - ~/.ssh/id_rsa
  
  folders:
      - map: ~/Sites
        to: /home/vagrant/code
  
  sites:
      - map: laravel.local
        to: /home/vagrant/code/laravel/public
        type: &quot;laravel&quot;
  
      - map: abc.local
        to: /home/vagrant/code/abc-ui/app
        type: abc
        variables:
            -   key: abc_TIER
                value: homestead
  
      - map: dev.abc.local
        to: /home/vagrant/code/abc/public
        type: dev
        variables:
            -   key: abc_TIER
                value: homestead
  
      - map: api.abc.local
        to: /home/vagrant/code/abc-backend/public
  
  databases:
      - homestead
      - dev
  
  features:
      - mysql8: true
      - pm2: true
      - webdriver: true
  
  variables:
      - key: ABC_TIER
        value: homestead
  </code></pre>
  <p><a href="https://i.stack.imgur.com/9eWyv.png" rel="noreferrer"><img src="https://i.stack.imgur.com/9eWyv.png" alt="enter image description here" /></a></p>
  <p>The framework/data/cache directory looks like this - the subdirectories look the same too (vagrant/vagrant and same drwxrwxrwx permissions).</p>
  <p>drwxrwxrwx 1 vagrant vagrant  160 Jul 20 09:50 .
  drwxrwxrwx 1 vagrant vagrant  160 Jul 17 15:06 ..
  drwxrwxrwx 1 vagrant vagrant   96 Jul 20 09:50 1c
  -rwxrwxrwx 1 vagrant vagrant 6148 Apr  3 10:52 .DS_Store
  -rwxrwxrwx 1 vagrant vagrant   14 Jul 17 15:06 .gitignore</p>