Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

file_put_contents , failed to open stream: No such file or directory Laravel [duplicate]

Tags:

php

laravel

I just want to run my client's project in to my local and having this problem.

ErrorException in compiled.php line 6301: file_put_contents(C:\xampp\htdocs\tiger\storage/framework/views/111182673e168569a2371e23629d9c08): failed to open stream: No such file or directory

it is something like permission issue .. and i am windows user don't know how to figure it ... experts can u help me ? Thanks in Advance.

like image 993
Wahid Nahiyan Avatar asked Aug 20 '15 18:08

Wahid Nahiyan


4 Answers

I had the same exact problem, try this

chmod -R guo+w storage

php artisan cache:clear
like image 53
imal hasaranga perera Avatar answered Nov 17 '22 05:11

imal hasaranga perera


In case anyone here is using Homestead like me, you can run into the same issue using PHPUnit.

When you run php artisan config:cache, Laravel hardcodes some paths in the cache. If you run it on your Homestead VM, it uses those paths. If you run it from your workstation, it uses those paths. You should make your cache from the Homestead VM and then execute your tests from there as well to avoid cache problems.

You can tell when the cache needs to be cleared by looking at the file path that PHPUnit tries to use. If it's not a valid path on the machine you're running the command from, you need to rebuild your cache.

like image 42
Ethan Hohensee Avatar answered Nov 17 '22 03:11

Ethan Hohensee


This solves the problem

php artisan cache:clear
like image 7
Viktor Jarnheimer Avatar answered Nov 17 '22 03:11

Viktor Jarnheimer


php artisan config:cache

This code clear the cache and delete cache files.

like image 7
Bijaya Kumar Oli Avatar answered Nov 17 '22 04:11

Bijaya Kumar Oli