• I installed WP-Super-Cache but couldn’t get it to work. I had the same problem with the Mod Rewrite as here. Anyway, I figure WP-Cache will be enough for my needs. So I set about uninstalling. All went fine but I cannot remove the cache folder. I chmod it to 777 but permission is denied – the owner/group is httpd and this might be the problem. I had the same problem with the advanced-cache.php (folder-looking file) but moving it into another folder and then deleting that folder (of which I was the owner/group) worked. This approach does not work with the cache folder since I do not have permission to move it. I even backed up my wp-content folder, without the rogue cache folder, and tried to delete the wp-content folder on the server. Of course everything else deleted except the cache folder!

    Any help on how I can remove this dang folder is much appreciated!

Viewing 9 replies - 16 through 24 (of 24 total)
  • Put opening and closing PHP tags at the top and bottom of that file. <?php and ?>

    put the code at which file and also location?
    I am cracking my head and i cant find the way to do it
    i would like to do a fresh installation….
    Please help!!!

    Put it into wp-content/t.php and then call https://yourhostname.tld/wp-content/t.php

    If you see an error, you may need to add this line at above the rmdir() commands:

    unlink( cache/.htaccess );

    It’s not as simple as that. The supercache directory is full of subdirectories. In my case I had to use a recursive function:

    <?php
    function removeDir($dirname)
    {
        if (!file_exists($dirname)) {
            return false;
        }
        if (is_file($dirname)) {
     	echo ("deleting: " . $dirname . '<br />');
            return unlink($dirname);
        }
        $dir = dir($dirname);
        while (false !== $entry = $dir->read()) {
            if ($entry == '.' || $entry == '..') {
                continue;
            }
            echo ("deleting: " . $dirname . DIRECTORY_SEPARATOR . $entry . '<br />');
            removeDir($dirname . DIRECTORY_SEPARATOR . $entry);
        }
        $dir->close();
        return rmdir($dirname);
    }
    
    unlink("cache/.htaccess");
    removeDir("cache/meta");
    removeDir("cache/supercache");
    removeDir("cache");
    ?>

    Use at your own risk.

    arminbw – did you have to use that with the latest version of the plugin? The deactivate hook calls a function that clears the cache directory and does what your function above does.

    Yes, I used the latest version. But generally the plugin didn’t work for me very well. Edited posts didn’t get updated and the supercache folder only contained empty subdirectories.

    I will try to install the plugin on another server, where I have root access, so I can investigate this a bit..

    arminbw’s PHP code is realy function, I used it and it deleted all this directories and files.

    (arminbw – Thanks ?? )

    I was able to delete advanced-cache.php by creating a new directory, moving the advanced-cache.php into it and deleting it.

    I had a similar problem removing the files. Moving the entire directory to another directory allowed me to then delete it.

    Mark

Viewing 9 replies - 16 through 24 (of 24 total)
  • The topic ‘[Plugin: WP Super Cache] Cannot delete cache folder after uninstall’ is closed to new replies.