apc.filters by path?

谁都会走 提交于 2019-12-03 13:32:10

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/.*"

A very late response, but just in case someone else is having this issue (I'm going to guess you may be/have been running a Plesk box, which is why I came across this).

Your best bet is to have APC in the list of loaded php modules, but have apc.enabled 0 in the master php.ini. Then, for each vhost you want to have it enabled for, add php_admin_value apc.enabled 1 to enable for each. Could be an issue if you have a ton of sites, but works for just a few.

pnomolos' solution works if you have different vhosts, but it won't work if you have only one and want to control caching on a truly per-directory basis.

This bug report points to the best the solution : https://bugs.php.net/bug.php?id=57064

Enable APC and set apc.cache_by_default to 0 in php.ini. In your Apache config, you can then use php_admin_setting apc.cache_by_default 1 inside a Directory block to enable APC caching exactly where you need it.

Since apc.filters works with regular expressions, wildcard path should be specified as apc.filters = "-/usr/share/psa-horde/.*"

Denis Bogdanov

Used:

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