Laravel 5 show ErrorException file_put_contents failed to open stream: No such file or directory

后端 未结 20 2078
北海茫月
北海茫月 2020-12-04 17:26

I have a project on Laravel 5 and I work with it at the office and at home too. It works fine, but recently at home it stopped working. Laravel show me two ErrorException

相关标签:
20条回答
  • 2020-12-04 17:56

    In case of shared hosting when you do not have command line access simply navigate to laravel/bootstrap/cache folder and delete (or rename) config.php and you are all done!

    0 讨论(0)
  • 2020-12-04 17:56

    The reason for this problem is the cache files in localhost. According to that I've tried several things as follows to clear the cache on my project, but every time I've failed.

    • Tried to clear cahe commands by changing web.php file (with artisan codes)
    • Tried to clear cache by connecting SSH (via PUTTY)
    • Tried to host my project in Sub domain within create a new Public directory

    So I've found a solution for this problem after each and every above steps failed and it worked for me perfectly. I deleted the cache.php file in host_route/bootstrap/cache directory.

    I think this answer will help your problem.

    0 讨论(0)
  • 2020-12-04 17:59

    Actually I faced this issue when I moved my project from server to local.

    in

    storage/framework

    four basic folders are required cache, sessions, testing, views

    In My case sessions was missing might be in gitignore.

    So I manually created session folder and refreshed browser and it was working.

    So any of the missing folder if we delete this problem can be solved.

    0 讨论(0)
  • 2020-12-04 17:59

    I used Laravel 8, This is my solution

    Goto: storage/framework/cache/data
    set permission directory data is 777

    It's worked for me

    0 讨论(0)
  • 2020-12-04 17:59

    This did the magic for me. chmod -Rf 0777 storage

    0 讨论(0)
  • 2020-12-04 18:00

    The best way to solve this problem is, go to directory laravel/bootstrap/cache and delete config.php file. or you can rename it as well like config.php.old And your problem will be fix. Happy coding :-)

    0 讨论(0)
提交回复
热议问题