如何“实际上”配置 PHP APC?

发布于 2024-12-21 17:02:43 字数 1539 浏览 1 评论 0原文

我有 VPS,它运行一个 wp 博客和一个简单的单页网站。我正在尝试使用 APC 来写博客。在安装 APC VPS 之前,它向我发送警报,称 WP index.php 正在吞噬所有内容。现在,安装 APC 后,这些警报已停止。但是当我使用 apc.php 检查结果时,我在系统缓存中没有看到任何文件。

这是 PHP 信息:

APC Support enabled
Version     3.1.9
APC Debugging   Disabled
MMAP Support    Enabled
MMAP File Mask  no value
Locking type    pthread mutex Locks
Serialization Support   php
Revision    $Revision: 308812 $
Build Date  Dec 13 2011 10:12:43

Directive   Local Value Master Value
apc.cache_by_default    On  On
apc.canonicalize    On  On
apc.coredump_unmap  Off Off
apc.enable_cli  Off Off
apc.enabled On  On
apc.file_md5    Off Off
apc.file_update_protection  2   2
apc.filters apc\.php$   apc\.php$
apc.gc_ttl  3600    3600
apc.include_once_override   Off Off
apc.lazy_classes    Off Off
apc.lazy_functions  Off Off
apc.max_file_size   1M  1M
apc.mmap_file_mask  no value    no value
apc.num_files_hint  1000    1000
apc.preload_path    no value    no value
apc.report_autofilter   Off Off
apc.rfc1867 Off Off
apc.rfc1867_freq    0   0
apc.rfc1867_name    APC_UPLOAD_PROGRESS APC_UPLOAD_PROGRESS
apc.rfc1867_prefix  upload_ upload_
apc.rfc1867_ttl 3600    3600
apc.serializer  default default
apc.shm_segments    1   1
apc.shm_size    30  30
apc.slam_defense    Off Off
apc.stat    On  On
apc.stat_ctime  Off Off
apc.ttl 0   0
apc.use_request_time    On  On
apc.user_entries_hint   100 100
apc.user_ttl    0   0
apc.write_lock  On  On

我对实际发生的情况感到困惑。我尝试阅读所有可能的来源,但我很困惑。如何只缓存 WP index.php 而不缓存其他内容?这是一个简单的 mod_php 设置,而不是 FastCGI 设置。

I have VPS and it runs a wp blog plus a simple one page site. I am trying to use APC for blog. Before installing APC VPS was sending me alerts saying WP index.php was eating up everything. Now after installing APC these alerts have stopped. But when I check the result using apc.php I don't see any file in system cache.

Here is the PHP Info:

APC Support enabled
Version     3.1.9
APC Debugging   Disabled
MMAP Support    Enabled
MMAP File Mask  no value
Locking type    pthread mutex Locks
Serialization Support   php
Revision    $Revision: 308812 $
Build Date  Dec 13 2011 10:12:43

Directive   Local Value Master Value
apc.cache_by_default    On  On
apc.canonicalize    On  On
apc.coredump_unmap  Off Off
apc.enable_cli  Off Off
apc.enabled On  On
apc.file_md5    Off Off
apc.file_update_protection  2   2
apc.filters apc\.php$   apc\.php$
apc.gc_ttl  3600    3600
apc.include_once_override   Off Off
apc.lazy_classes    Off Off
apc.lazy_functions  Off Off
apc.max_file_size   1M  1M
apc.mmap_file_mask  no value    no value
apc.num_files_hint  1000    1000
apc.preload_path    no value    no value
apc.report_autofilter   Off Off
apc.rfc1867 Off Off
apc.rfc1867_freq    0   0
apc.rfc1867_name    APC_UPLOAD_PROGRESS APC_UPLOAD_PROGRESS
apc.rfc1867_prefix  upload_ upload_
apc.rfc1867_ttl 3600    3600
apc.serializer  default default
apc.shm_segments    1   1
apc.shm_size    30  30
apc.slam_defense    Off Off
apc.stat    On  On
apc.stat_ctime  Off Off
apc.ttl 0   0
apc.use_request_time    On  On
apc.user_entries_hint   100 100
apc.user_ttl    0   0
apc.write_lock  On  On

I am confused as what is actually going on. I have tried to read all possible sources but I am getting confused. How do I make only cache WP index.php and not others? It's a simple mod_php set up not the FastCGI setup.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

恏ㄋ傷疤忘ㄋ疼 2024-12-28 17:02:43

就像评论所说,我不知道为什么你不希望缓存所有内容。

然而,根据 文档。您可以在 apc.filters 属性中使用正则表达式来排除除 index.php 文件之外的所有内容。我不是正则表达式专家,但是您的 apc.ini 中类似的内容应该可以工作;

apc.filter=!index\.php

Like the comment says, I have no idea why you wouldn't want everything cached.

However, there seems to be a way to do what you want, according to the docs. You can use a regex in the apc.filters property to exclude everything except the index.php file. I'm not a regex expert, but something along the lines of this in your apc.ini should work;

apc.filter=!index\.php

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文