Take the 2-minute tour ×

If APC stores a lot of entries, clearing them crashes httpd.

*If apc_clear_cache('user') takes longer than phps max_execution_time the script calling apc_clear_cache will be terminated by php before the clearing-operation is finished. this seems to leave some handles or sth. that will prevent apache from closing it's processes.*


Is there some other quick but safe way of bulk cleanup of APC cache?

share|improve this question
add comment

2 Answers

up vote 4 down vote accepted

You can remove the time limit on a script you're running (as long as you don't run php in safe mode)


This will remove the time limit for the script

http://au2.php.net/manual/en/function.set-time-limit.php for more details

share|improve this answer
I just noticed that this was the suggested workaround for the problem in the link you posted :) –  Thomas Winsnes Feb 9 '10 at 10:36
add comment

You can also gracefully restart apache and it will reload with a clean APC.

share|improve this answer
is this a valid approach in a production environment when one would gracefully restart apache after a new deployment version of an app? –  Jorre Nov 15 '10 at 22:56
it's acceptable if you don't care about a second of down time. –  Mike Mar 18 '11 at 11:47
Gracefully restarting Apache doesn’t cause any downtime at all, not even a second. –  Scytale Mar 7 '12 at 11:16
So three people agree with me but none up-voted my answer... hmmm :( –  Collector Mar 8 '12 at 11:45
add comment

Your Answer


