我目前在 CentOs 服务器上安装并运行了 APC,它工作正常,但它目前缓存了所有目录中的所有文件。
如何更改设置以便它只缓存我选择的目录?
例如,我可以使用 .htaccess 在一个目录中启用它吗?
我目前在 php.ini
中仅有的 APC 设置如下:
extension = apc.so
apc.enabled = 1
apc.shm_size = 30
最佳答案
apc.filters string
A comma-separated list of POSIX extended regular expressions. If any pattern matches the source filename, the file will not be cached. Note that the filename used for matching is the one passed to include/require, not the absolute path. If the first character of the expression is a + then the expression will be additive in the sense that any files matched by the expression will be cached, and if the first character is a - then anything matched will not be cached. The - case is the default, so it can be left off.
这是一个 PHP_INI_SYSTEM 参数,所以您只能在每个目录的基础上执行此操作如果您正在 cgi/suEXEC/suPHP 下运行并且可以在每个目录的基础上设置您的 php.ini。
关于php - 仅为特定目录启用 APC?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11421494/