问题
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.
(http://pecl.php.net/bugs/bug.php?id=13445)
Is there some other quick but safe way of bulk cleanup of APC cache?
回答1:
You can remove the time limit on a script you're running (as long as you don't run php in safe mode)
set_time_limit(0);
This will remove the time limit for the script
http://au2.php.net/manual/en/function.set-time-limit.php for more details
回答2:
You can also gracefully restart apache and it will reload with a clean APC.
来源:https://stackoverflow.com/questions/2228213/how-to-clear-apc-cache-without-crashing-apache