Search

Please provide a valid cache path

post-title

While working on remote server, you might face folder permission issues which hardly face in local server. Today I will discuss one of them in Laravel application.

After you deploy your application to live server, you may get Laravel error "Please provide a valid cache path." This is because by default all Laravel sessions, cache and compiled files are stored in /storage/framework folders and these folders are mission in your project and storage folder doesn't have enough permission to create these folders. These are below folders should be added:

/var/www/application/storage/framework/

  • sessions
  • views
  • cache

So to solve the issue, you have to create these subfolders and give them permissions. You can create them using server CPanel. Another way is by login to ssh and use command line to create folders. To use command line, first login to remove server and run the below commands to create the subfolders

cd /var/www/application/storage/
mkdir -p framework/{sessions,views,cache}

Now give them permission

sudo chmod -R 777 framework

That's it. The error should have solved.