title: ErrorException in Filesystem.php - Permission denied
body: <p>I am trying to access my Laravel application on my local machine and am receiving the following error when accessing any pages:</p>
  
  <blockquote>
    <p>ErrorException in Filesystem.php line 109:
    file_put_contents(/4d76273a26d1b0fbe2c62bffa1ba6fb5ec8c358b.php): failed to open stream: Permission denied</p>
  </blockquote>
  
  <p>I have tried running <code>chmod -R 0777 storage</code> on my <code>storage</code> directory, while this is updated no changes take affect on the Laravel app.</p>
  
  <p>Can someone advise how I can fix this?</p>
  
  <p>Edit: </p>
  
  <p><strong>Added debug log</strong></p>
  
  <pre><code>#1 /home/vagrant/loot/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(109): file_put_contents('/4d76273a26d1b0...', '&lt;?php $__env-&gt;s...', 0)
  #2 /home/vagrant/loot/vendor/laravel/framework/src/Illuminate/View/Compilers/BladeCompiler.php(116): Illuminate\Filesystem\Filesystem-&gt;put('/4d76273a26d1b0...', '&lt;?php $__env-&gt;s...')
  #3 /home/vagrant/loot/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(51): Illuminate\View\Compilers\BladeCompiler-&gt;compile('/home/vagrant/l...')
  #4 /home/vagrant/loot/vendor/laravel/framework/src/Illuminate/View/View.php(147): Illuminate\View\Engines\CompilerEngine-&gt;get('/home/vagrant/l...', Array)
  #5 /home/vagrant/loot/vendor/laravel/framework/src/Illuminate/View/View.php(118): Illuminate\View\View-&gt;getContents()
  #6 /home/vagrant/loot/vendor/laravel/framework/src/Illuminate/View/View.php(83): Illuminate\View\View-&gt;renderContents()
  #7 /home/vagrant/loot/vendor/laravel/framework/src/Illuminate/Http/Response.php(53): Illuminate\View\View-&gt;render()
  #8 /home/vagrant/loot/vendor/symfony/http-foundation/Response.php(199): Illuminate\Http\Response-&gt;setContent(Object(Illuminate\View\View))
  #9 /home/vagrant/loot/vendor/laravel/framework/src/Illuminate/Routing/Router.php(1087): Symfony\Component\HttpFoundation\Response-&gt;__construct(Object(Illuminate\View\View))
  #10 /home/vagrant/loot/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(94): Illuminate\Routing\Router-&gt;prepareResponse(Object(Illuminate\Http\Request), Object(Illuminate\View\View))
  #11 [internal function]: Illuminate\Routing\ControllerDispatcher-&gt;Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
  #12 /home/vagrant/loot/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(52): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
  #13 /home/vagrant/loot/app/Http/Middleware/RedirectIfAuthenticated.php(24): Illuminate\Routing\Pipeline-&gt;Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
  #14 [internal function]: App\Http\Middleware\RedirectIfAuthenticated-&gt;handle(Object(Illuminate\Http\Request), Object(Closure))
  #15 /home/vagrant/loot/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)
  #16 [internal function]: Illuminate\Pipeline\Pipeline-&gt;Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
  #17 /home/vagrant/loot/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
  #18 [internal function]: Illuminate\Routing\Pipeline-&gt;Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
  #19 /home/vagrant/loot/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
  #20 /home/vagrant/loot/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(96): Illuminate\Pipeline\Pipeline-&gt;then(Object(Closure))
  #21 /home/vagrant/loot/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(54): Illuminate\Routing\ControllerDispatcher-&gt;callWithinStack(Object(App\Http\Controllers\Auth\AuthController), Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request), 'showLoginForm')
  #22 /home/vagrant/loot/vendor/laravel/framework/src/Illuminate/Routing/Route.php(174): Illuminate\Routing\ControllerDispatcher-&gt;dispatch(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request), 'App\\Http\\Contro...', 'showLoginForm')
  #23 /home/vagrant/loot/vendor/laravel/framework/src/Illuminate/Routing/Route.php(140): Illuminate\Routing\Route-&gt;runController(Object(Illuminate\Http\Request))
  #24 /home/vagrant/loot/vendor/laravel/framework/src/Illuminate/Routing/Router.php(724): Illuminate\Routing\Route-&gt;run(Object(Illuminate\Http\Request))
  #25 [internal function]: Illuminate\Routing\Router-&gt;Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
  #26 /home/vagrant/loot/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(52): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
  #27 /home/vagrant/loot/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(64): Illuminate\Routing\Pipeline-&gt;Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
  #28 [internal function]: Illuminate\Foundation\Http\Middleware\VerifyCsrfToken-&gt;handle(Object(Illuminate\Http\Request), Object(Closure))
  #29 /home/vagrant/loot/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)
  #30 [internal function]: Illuminate\Pipeline\Pipeline-&gt;Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
  #31 /home/vagrant/loot/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
  #32 /home/vagrant/loot/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\Routing\Pipeline-&gt;Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
  #33 [internal function]: Illuminate\View\Middleware\ShareErrorsFromSession-&gt;handle(Object(Illuminate\Http\Request), Object(Closure))
  #34 /home/vagrant/loot/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)
  #35 [internal function]: Illuminate\Pipeline\Pipeline-&gt;Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
  #36 /home/vagrant/loot/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
  #37 /home/vagrant/loot/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(62): Illuminate\Routing\Pipeline-&gt;Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
  #38 [internal function]: Illuminate\Session\Middleware\StartSession-&gt;handle(Object(Illuminate\Http\Request), Object(Closure))
  #39 /home/vagrant/loot/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)
  #40 [internal function]: Illuminate\Pipeline\Pipeline-&gt;Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
  #41 /home/vagrant/loot/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
  #42 /home/vagrant/loot/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\Routing\Pipeline-&gt;Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
  #43 [internal function]: Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse-&gt;handle(Object(Illuminate\Http\Request), Object(Closure))
  #44 /home/vagrant/loot/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)
  #45 [internal function]: Illuminate\Pipeline\Pipeline-&gt;Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
  #46 /home/vagrant/loot/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
  #47 /home/vagrant/loot/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(59): Illuminate\Routing\Pipeline-&gt;Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
  #48 [internal function]: Illuminate\Cookie\Middleware\EncryptCookies-&gt;handle(Object(Illuminate\Http\Request), Object(Closure))
  #49 /home/vagrant/loot/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)
  #50 [internal function]: Illuminate\Pipeline\Pipeline-&gt;Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
  #51 /home/vagrant/loot/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
  #52 [internal function]: Illuminate\Routing\Pipeline-&gt;Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
  #53 /home/vagrant/loot/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
  #54 /home/vagrant/loot/vendor/laravel/framework/src/Illuminate/Routing/Router.php(726): Illuminate\Pipeline\Pipeline-&gt;then(Object(Closure))
  #55 /home/vagrant/loot/vendor/laravel/framework/src/Illuminate/Routing/Router.php(699): Illuminate\Routing\Router-&gt;runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
  #56 /home/vagrant/loot/vendor/laravel/framework/src/Illuminate/Routing/Router.php(675): Illuminate\Routing\Router-&gt;dispatchToRoute(Object(Illuminate\Http\Request))
  #57 /home/vagrant/loot/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(246): Illuminate\Routing\Router-&gt;dispatch(Object(Illuminate\Http\Request))
  #58 [internal function]: Illuminate\Foundation\Http\Kernel-&gt;Illuminate\Foundation\Http\{closure}(Object(Illuminate\Http\Request))
  #59 /home/vagrant/loot/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(52): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
  #60 /home/vagrant/loot/vendor/barryvdh/laravel-debugbar/src/Middleware/Debugbar.php(49): Illuminate\Routing\Pipeline-&gt;Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
  #61 [internal function]: Barryvdh\Debugbar\Middleware\Debugbar-&gt;handle(Object(Illuminate\Http\Request), Object(Closure))
  #62 /home/vagrant/loot/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)
  #63 [internal function]: Illuminate\Pipeline\Pipeline-&gt;Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
  #64 /home/vagrant/loot/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
  #65 /home/vagrant/loot/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(44): Illuminate\Routing\Pipeline-&gt;Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
  #66 [internal function]: Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode-&gt;handle(Object(Illuminate\Http\Request), Object(Closure))
  #67 /home/vagrant/loot/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)
  #68 [internal function]: Illuminate\Pipeline\Pipeline-&gt;Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
  #69 /home/vagrant/loot/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
  #70 [internal function]: Illuminate\Routing\Pipeline-&gt;Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
  #71 /home/vagrant/loot/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
  #72 /home/vagrant/loot/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(132): Illuminate\Pipeline\Pipeline-&gt;then(Object(Closure))
  #73 /home/vagrant/loot/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(99): Illuminate\Foundation\Http\Kernel-&gt;sendRequestThroughRouter(Object(Illuminate\Http\Request))
  #74 /home/vagrant/loot/public/index.php(53): Illuminate\Foundation\Http\Kernel-&gt;handle(Object(Illuminate\Http\Request))
  #75 {main}  
  </code></pre>