Clear Cache Doesn't Work Inside Admin Panel

Hi everyone. So a previous issue brought me to the realization that my "Clear Cache" button inside my Admin Panel doesn't actually clear my var/cache/.

It still gives me the notification letting me know that it "Successfully cleared the cache" but it really doesn't do anything. I have to log in through my FTP to delete that folder.

So this is some kind of permissions issue, but I don't know what/where to fix that. Any advice?

/config.local.php

// Default permissions for newly created files and directories
define('DEFAULT_FILE_PERMISSIONS', 0666);
define('DEFAULT_DIR_PERMISSIONS', 0777);

666 and 777 are not necessarily the right permissions. The best thing is to check with your hosting company and determine what "mode" PHP runs in on your server and ask them what the correct (most secure) permissions should be and set those values in your config.local.php. Then manually remove the var/cache directory and it's sub-folders and allow cs-cart to recreate them.

In the vast majority of hosting environments, the permissions should be 755/644. But check with your hosting.

If the cache becomes really large it might take a couple of attempts via admin panel to complete since the operation can time out and there's really no indication that it has succeeded or failed.

Note that this feature clears system cache, not templates one

&cc&ctpl?

You also have to check what the current permissions are on the caches now. If the web server cannot delete them .. then that is why.

755/644 are the correct permissions under suPHP ... so if you have modified your config you need to CHMOD the files to these permissions.

https://www.fdgweb.com/how-to-chmod-all-files-to-644-and-all-directories-to-775-via-ssh/

Or .. CHOWN them if they are not owned correctly. Yo may have installed the cart under one user .. but every time a file is dynamically created, it is owned by Apache or a user that can or cannot R/W/X correctly.

Only after normalizing all permissions can you see if this is the issue.

Note - this seems to be the issue 99% of the time when people call us to help with the cache not clearing ..

Our hosting company setup a cron job to clear the cache twice a day in public_html/var/cache.

I hope this fixes the issue we experience as I hate the message "Oops there's a problem" when visiting our website.

Hi everyone. So a previous issue brought me to the realization that my "Clear Cache" button inside my Admin Panel doesn't actually clear my var/cache/.

It still gives me the notification letting me know that it "Successfully cleared the cache" but it really doesn't do anything. I have to log in through my FTP to delete that folder.

So this is some kind of permissions issue, but I don't know what/where to fix that. Any advice?

Shouldn't be needed if your ownerships/permissions are setup properly. Clearing the cache twice a day seems wasteful and it won't clear on other internal operations like when settings are changed, addons installed, etc.

You should fix the root-cause of the problem versus trying to band-aid it with a cron job. There are tons of responses on ownership/permissions issues in this forum.