title: PHP Beanstalk with laravel permission denied on storage/framework/cache
body: <p>I've deployed my Laravel 5.1 app using Amazing Beanstalk and after repeated usage I eventually get this error.</p>
  
  <pre><code>"file_put_contents(/var/app/current/storage/framework/cache/d4/d7/d4d77eddeb64100f6da8f8b601a4631b): failed to open stream: Permission denied"
  </code></pre>
  
  <p>In my .ebextensions config file I've tried adding this command to deployment but it does not solve the problem since the files seem to get created after deployment as the site is browsed.</p>
  
  <pre><code>container_commands:
    "02-chmod-storage":
      command: "cd /var/app/ondeck;  chmod -R 777 storage"
  </code></pre>
  
  <p>How can I fix this permanently?</p>