gpt4 book ai didi

php - apc.filters 按路径?

转载 作者:可可西里 更新时间:2023-11-01 12:48:50 26 4
gpt4 key购买 nike

我如何在 APC 操作码缓存中使用 apc.filters 参数来不缓存某些路径?例如,我希望缓存对路径下的任何内容都有效:

“/var/www/vhosts”

并排除像这样的路径

“/usr/share/psa-horde/”

我试过用

apc.cache_by_default = 0
apc.filters = "+/var/www/vhosts"

apc.cache_by_default = 1
apc.filters = "-/usr/share/psa-horde/"

但两者都没有达到我的预期。

http://www.php.net/manual/en/apc.configuration.php#ini.apc.filters

过滤器是否应该更像“+/var/www/vhosts/*”(注意通配符)?恐怕这是不可能的,因为过滤器的工作方式:

Note that the filename used for matching is the one passed to include/require, not the absolute path.

任何想法或示例配置?

最佳答案

过滤器应该是逗号分隔的 POSIX 扩展正则表达式列表。我相信你在第二次尝试中所拥有的只匹配确切的路径/usr/share/psa-horde/,而不匹配/usr/share/psa-horde/something 或/usr/share/psa-horde/anotherfile.php

以下内容应与子文件夹中的任何内容匹配

apc.filters = "-/usr/share/psa-horde/.*"

关于php - apc.filters 按路径?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1626262/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com