PLATFORM
  • Tails

    Create websites with TailwindCSS

  • Wave

    Start building the next great SAAS

  • Pines

    Alpine & Tailwind UI Library

  • Auth

    Plug'n Play Authentication for Laravel

  • Designer comingsoon

    Create website designs with AI

  • DevBlog comingsoon

    Blog platform for developers

  • Static

    Build a simple static website

  • SaaS Adventure

    21-day program to build a SAAS

Written By

How to fix 'Please provide a valid cache path' error in Laravel?

How to fix 'Please provide a valid cache path' error in Laravel?

Introduction

The other day, I was setting up a local development environment for an existing project when I encountered the 'Please provide a valid cache path' error.

As the error itself is not very descriptive and could leave you thinking that something is wrong with your configuration, I've decided to write a short post on how to get this sorted out!

Creating the cache folders

By default Laravel stores its temporary files at the storage/framework directory. In there there should be 3 more folders: sessions, views and cache.

That is where Laravel will store its generated blade views, cache and sessions.

Without those 3 directories you might see the error above.

To create the directories you could run the following command.

  • First use the cd command to access the location of your Laravel application and then run:
mkdir storage/framework/{sessions,views,cache}

The above command will create the 3 directories in question.

Clearing the cache

After that you could run the following commands to clear your cache and make sure that it works as expected:

php artisan cache:clear
php artisan config:clear
php artisan view:clear

You should see the following output:

Application cache cleared!
Configuration cache cleared!
Compiled views cleared!

Conclusion

This is pretty much it! I hope that this post helps you to solve the problem in question!

If you are working as a DevOps engineer, check out this DevOps Scorecard and evaluate your DevOps skills across 8 key areas and discover your strengths and growth opportunities

Comments (0)

loading comments