How to clear APC cache without crashing Apache?

放肆的年华 提交于 2019-12-22 10:55:09

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!