Warning: include_once(/www/templates/gt/parts/blogs/carptips/first.php) [function.include-once]: failed to open stream: No such file or directory in /www/gt/docs/carp/tips/2004/10/help-i-cant-delete-cache-directories.php on line 19

Warning: include_once() [function.include]: Failed opening '/www/templates/gt/parts/blogs/carptips/first.php' for inclusion (include_path='.:/usr/local/lib/php') in /www/gt/docs/carp/tips/2004/10/help-i-cant-delete-cache-directories.php on line 19

Saturday, October 09, 2004

Help! I can't delete the cache directories! 

If you've ever tried deleting CaRP, you've probably noticed that without root access to your server, getting rid of the cache directories can be a little tricky. The problem is that the cache directories and their contents were created by the web server, not by you, so you don't have the necessary access priviledges to delete them. Fortunately, there's an easy solution--easy once you know what it is!

The first thing you need to do is delete all the cache files. To do that, create a PHP file like this, upload it to your server, and load it in your web browser:

<?php
require_once "/path/to/carp.php";
CarpClearCache(0);
CarpClearCache(1);
CarpClearCache(2);
?>

Once that's done, you'll be able to delete the cache folders even though you don't own them. Why? Because you own the directory that contains them.

UPDATE: Here's a script that will both empty and delete the cache folders, as well as displaying error messages if something goes wrong:

<?php
require_once '/path/to/carp.php';
CarpConf('phperrors',E_ALL);
CarpClearCache(0);
CarpClearCache(1);
CarpClearCache(2);
rmdir(CarpAggregatePath());
rmdir(CarpCachePath());
rmdir(CarpAutoCachePath();
?>
// posted by Antone Roundy @ 9:12 AM

16 Comments:

By Anonymous Anonymous, at October 05, 2005 2:14 AM  

Seems so simple this - why didn't I think of it!

Many thanks.

By Anonymous Anonymous, at February 03, 2006 11:22 PM  

I do this, but when I load the php clear file in my browser, it only displays the feed and doesn't have any other affect.

By Blogger Antone Roundy, at February 04, 2006 8:06 AM  

Does the file have any other contents than the following?

<?php
require_once "/path/to/carp.php";
CarpClearCache(0);
CarpClearCache(1);
CarpClearCache(2);
?>

Unless you've added code to carp.php or carpconf.php to cause it to display a feed, that code shouldn't display a feed.

By Anonymous Anonymous, at February 05, 2006 7:30 PM  

Fixed :D. It helps to have the correct path.

One thing I'd like to be able to do with carp, is have more control over the formatting.

For example I can't change the format of the description and can't change the formatting of the link visited, hover etc. of the item title. Unless I'm not doing something. Basically it would be sweet as if you could format each of the description, title, date, properties with full css.

Thanks for the free software and the support you offer.

By Blogger Antone Roundy, at February 06, 2006 4:51 PM  

This article on avoiding overuse of CSS classes will show you how to control the link formatting (including hover, active, visited, etc.) To use CSS with the description, do this:

CarpConf('bidesc','<div class="yourclass">');
CarpConf('aidesc','</div>');

...where "yourclass" is your CSS class that you've defined to control the formatting of the description.

By Blogger Joshua Uebergang, at February 23, 2006 9:29 PM  

How do I clear a mySQL database? Because I get the error:

Unable to access cache folder.

and I use mySQL

By Blogger Joshua Uebergang, at March 09, 2006 9:37 PM  

Oh well. I figured out a dodgy way. I just upload the file the feed is being displayed on and it gets updated.

By Blogger Antone Roundy, at March 10, 2006 11:18 AM  

To clear a database cache, make sure youve' got the database configuration code in carpconf.php as suggested by the installation script, or add it to the code shown above.

By Blogger Joshua Uebergang, at March 12, 2006 7:42 PM  

Sorry for being such a pain but what do you mean add it to the code above?

Do you mean add the carpconf.php code into that seperate file you explained above to clear a cache database?

By Anonymous Anonymous, at April 19, 2006 2:31 AM  

I did as you said and nothing happened (empty screen once the php file loaded). I still have an error 550 saying the directory is not empty.

By Blogger Antone Roundy, at April 19, 2006 12:26 PM  

Sorry for being such a pain but what do you mean add it to the code above?
By "add it to the code above", I meant add it (the database configuration code that you got from the installation script) after the "require_once" line in the code that calls CarpClearCache three times--between require_once... and the first call to CarpClearCache. But if you're using mySQL caching, the database configuration code should really be in carpconf.php anyway.

I did as you said and nothing happened (empty screen once the php file loaded). I still have an error 550 saying the directory is not empty.
The empty screen is expected, since there's nothing in the code that causes anything to be displayed. Just to be sure no errors are occuring though, try adding this just after the "require_once" line:

CarpConf('phperrors',E_ALL);

Then run that script again. If there are no error messages, the cache directories should be empty. Try deleting them one at a time and see if you can delete some, if not all of them.

By Anonymous Anonymous, at July 29, 2006 5:35 PM  

I am in way over my head here. I only fiddled around installing carp because it was something I could use but, my design ideas changed so I deleted all of the files except the cache folders which ... as you know ... aren't going anywhere ...

I made a php file out of the code above, the first example .. ran it ... and nothing has changed.

I have no idea what to do. My only experience with php is using includes to make updating menus on my sites easier.

Honestly, I don't know the where to start and now I have two installations of carp on the server (which obviously I don't have root access to) and now twice the undeleteable cache folders.

I really need to get rid of these things.

I ran both of the above examples at one point or another, no luck any of those times. I think I got the paths right ... the first time I tried deleting the folders I had already deleted the rest of the carp files and then I uploaded carp.php again ... to see if that is the file I should be sure to be targeting in the path ... no luck ... ended up reinstalling the darn thing in the main directory in an attempt to replace the files ...

it's a mess.
I need to get rid of these folders.
There are two sets of them now ... I have NO idea why it isn't working just by running the above mentioned php file.

I make a php file ... with ONLY the above code in it ... I run it ... it's blank or there's some errors ... I wish I could just nuke them off there with the power of my mind hahaha ... and my web host takes decades to reply so I'm not waiting on those people ... I have a site to get up before august ... I'm a design man, when I have to start messing with permissions and ownerships and all this ... it's over my head

By Blogger vikram, at February 16, 2007 11:21 AM  

where the carp.php file in the server. I don't see it my server.

By Anonymous Anonymous, at June 09, 2007 5:38 AM  

I did as you said and nothing happened (empty screen once the php file loaded). I still have an error 550 saying the directory is not empty.
I also get a 550 Permission Denied when trying to remove the folders after running this code.

Also, when running the second file (with error handling and auto-removing the directories), I get three errors like this:
Warning: rmdir(/var/www/vhosts/****************.com/httpdocs/carp/aggregatecache/): Permission denied in /var/www/vhosts/clusterofdifferentiation.com/httpdocs/carp/remove.php on line 7

Also, there is a bracket missing from the seond piece of code on the last line.

So. Here I am. I installed your script. Didn't find it versatile enough. Decided to remove it. And now I'm stuck with folders on my website that you put there, impossible for me to remove. Thanks a lot, Antone. Just great.

I'll go contact my webhost to get it removed. Thanks a lot for wasting my time.

By Anonymous Anonymous, at October 07, 2008 12:17 AM  

hello sir , i dint understand that what is the content of carp.php and how can i add it to the server

By Anonymous Anonymous, at October 07, 2008 12:21 AM  

Hello sir, here , great post but it didnt help us to get all the necessary inforamtion like what is the content of cart.php, how to get it to server.

Post a Comment

http://carp.docs.geckotribe.com/tips/2004/10/help-i-cant-delete-cache-directories.php

This page is powered by Blogger. Isn't yours?


Warning: include_once(/www/templates/gt/parts/blogs/carptips/second.php) [function.include-once]: failed to open stream: No such file or directory in /www/gt/docs/carp/tips/2004/10/help-i-cant-delete-cache-directories.php on line 165

Warning: include_once() [function.include]: Failed opening '/www/templates/gt/parts/blogs/carptips/second.php' for inclusion (include_path='.:/usr/local/lib/php') in /www/gt/docs/carp/tips/2004/10/help-i-cant-delete-cache-directories.php on line 165
ARCHIVES

Warning: include_once(/www/templates/gt/parts/blogs/carptips/third.php) [function.include-once]: failed to open stream: No such file or directory in /www/gt/docs/carp/tips/2004/10/help-i-cant-delete-cache-directories.php on line 172

Warning: include_once() [function.include]: Failed opening '/www/templates/gt/parts/blogs/carptips/third.php' for inclusion (include_path='.:/usr/local/lib/php') in /www/gt/docs/carp/tips/2004/10/help-i-cant-delete-cache-directories.php on line 172