php artisan cache clear failed to clear cache make sure you have the appropriate permissions
[L5.7] Cache clear fails #25451
Comments
moharrum commented Sep 5, 2018
Description:
Attempting to clear app cache returns an error message:
Failed to clear cache. Make sure you have the appropriate permissions.
Steps To Reproduce:
The text was updated successfully, but these errors were encountered:
We are unable to convert the task to an issue at this time. Please try again.
The issue was successfully created but we are unable to update the comment at this time.
sisve commented Sep 5, 2018
What cache driver are you using, and do you have the appropriate permissions?
ferdikam commented Sep 5, 2018
Hi,
I too have the same problem after a new installation of laravel.
moharrum commented Sep 5, 2018
khaledelmahdi commented Sep 6, 2018
AegirLeet commented Sep 6, 2018 •
The «data» directory (storage/framework/cache/data) doesn’t exist by default, which causes the check at
Lines 144 to 146 in 9c844aa
billrobclark commented Sep 8, 2018
I have this issue as well after upgrading to 5.7
m-lotze commented Sep 10, 2018 •
I am using redis for all caches.
AegirLeet commented Sep 10, 2018 •
When using redis with tags, the error is caused at
Also, when using the DB store,
Lines 222 to 225 in 544b759
alkapatel commented Sep 12, 2018
same cache problem here, how can solve it?
AegirLeet commented Sep 12, 2018
@alkapatel If you’re using the file store driver, create the storage/framework/cache/data directory manually.
elias-alea commented Sep 25, 2018
@taylorotwell closed this but a fresh install of laravel 5.7 today gave me this same issue. What am I missing?
tramel-woodard commented Sep 26, 2018
phannaly commented Sep 26, 2018 •
elias-alea commented Sep 27, 2018
Thanks loads. Quick question, how do I know which solutions to trust? The ones closed by contributors?
Also, I think this information could be added to the documentation here: https://laravel.com/docs/5.7/cache#configuration
phannaly commented Sep 27, 2018
@elias-alea If you install laravel now, you will get storage/framework/cache/data directory automatically so you don’t have to create it. They leave this directory to allow the filesystem to cache.
elias-alea commented Sep 27, 2018
@phannaly noted, awesome!
@taylorotwell and team, thanks loads, you are the men!
mfn commented Sep 27, 2018
The upgrade guide has now a reference to the missing data/ directory (section «Cache»)
haroloe commented Oct 6, 2018
SI, al agregar esta carpeta data, este problema queda solucionado, Muchas Gracias
gabriel9944 commented Oct 16, 2018
mitulvc commented Oct 26, 2018
markdark09 commented Nov 3, 2018 •
Just only add folder name «data» in storage/framework/cache/ and try php artisan cache:clear.
phpguru commented Dec 21, 2018
arthur-lbchn commented Jan 9, 2019
the same issue, however, the «storage/framework/cache/data» folder exists.
[laravel]$ php artisan cache:clear
Failed to clear cache. Make sure you have the appropriate permissions.
Laravel Framework 5.7.18
PHP 7.2.13
10.1.37-MariaDB
phpguru commented Jan 10, 2019
@alterman1994 I would chown it and/or chmod it (recursively) if needed, to the user running artisan command. If it got created by www-data, it can give permissions issue when running as logged in user. On our servers (Ubuntu) we add ubuntu, root, www-data to www-group and chown group ownership to www-group. HTH-
alexdpunkt commented May 14, 2019
Wouldn’t it be smart if laravel created the data directory on cache:clear automatically if it doesn’t exist?
RamizMurtaza commented Aug 19, 2019
same cache problem here, how can solve it?
Hi Babs!
Please check your cache path i think you are missing local folder in after stroage. Follow this path and it will fix the problem
‘file’ => [
‘driver’ => ‘file’,
‘path’ => storage_path(‘local/framework/cache/data’),
],
AravindhGopi commented Jan 14, 2020 •
php artisan cache:clear
command worked after
php artisan config:cache
rakshitbharat commented Feb 28, 2020
Use this package, It will tackle all cache and clean it properly.
lorebook commented Mar 23, 2020
I am following below blog documentation it’s working well
connor11528 commented May 29, 2020 •
This solved issue for me 🙂
goncoolio commented Jul 18, 2020
Me i resolve this problem with php artisan config:cache and after php artisan cache:clear
driesvints commented Jul 18, 2020
I’m locking this issue because it either has gone off-topic, become a dumping ground for things which shouldn’t be in an issue tracker or is just too old. Please try to discuss things further on one of the below channels: