apc.filters通过路径?

编程入门 行业动态 更新时间:2024-10-09 20:27:30
本文介绍了apc.filters通过路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

如何在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/"

但是它们都不如我预期的那样工作.

www.php/manual/zh-CN/apc.configuration.php#ini.apc.filters

过滤器应该更像"+/var/www/vhosts/*"(请注意通配符)吗?恐怕由于过滤器的工作方式,这是不可能的:

请注意,用于 匹配是传递给 包含/要求,不是绝对的 路径.

有任何想法或示例配置吗?

解决方案

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

以下内容应与子文件夹中的所有内容匹配

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

How would I use the apc.filters parameter in APC opcode caching to not cache certain paths? For example, I want caching to be active for anything under the path:

"/var/www/vhosts"

and exclude paths like

"/usr/share/psa-horde/"

I tried using

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

and

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

But neither worked as I expected.

www.php/manual/en/apc.configuration.php#ini.apc.filters

Should the filter be something more like "+/var/www/vhosts/*" (note the wildcard)? I'm afraid this isn't possible because of the way filters works:

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

Any ideas or sample configurations?

解决方案

The filter should be a comma separated list of POSIX extended regular expressions. I believe what you have in the second attempt only matches the exact path /usr/share/psa-horde/, and not /usr/share/psa-horde/something or /usr/share/psa-horde/anotherfile.php

The following should match anything in the sub folder

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

更多推荐

apc.filters通过路径?

本文发布于:2023-11-28 18:09:14,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1643429.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:路径   apc   filters

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!