php - 仅为特定目录启用 APC?

标签 php linux caching centos apc

我目前在 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/

相关文章:

php - 存储文件夹问题 - 获取无效参数异常

php - MVC路由如何工作?

linux - 如何同时打开 ssh 和启动命令?

linux - TCP SYN/SYN ACK 的 IP header 中的 Dscp 值

firefox - 我可以从 Firefox 缓存中删除特定文件吗?

c# - 为什么使用 System.Runtime.Caching 或 System.Web.Caching 而不是静态变量?

java - ArrayList.size() 方法是否被缓存?

php - 使用 NULL 作为输入参数在 PHP 中执行多个查询

php - 将数字添加到自身并仅打印最后一个值的更好方法

linux - 保存第一行 - Linux Shell 脚本