<bdo id='IkjgO'></bdo><ul id='IkjgO'></ul>
<i id='IkjgO'><tr id='IkjgO'><dt id='IkjgO'><q id='IkjgO'><span id='IkjgO'><b id='IkjgO'><form id='IkjgO'><ins id='IkjgO'></ins><ul id='IkjgO'></ul><sub id='IkjgO'></sub></form><legend id='IkjgO'></legend><bdo id='IkjgO'><pre id='IkjgO'><center id='IkjgO'></center></pre></bdo></b><th id='IkjgO'></th></span></q></dt></tr></i><div id='IkjgO'><tfoot id='IkjgO'></tfoot><dl id='IkjgO'><fieldset id='IkjgO'></fieldset></dl></div>

      1. <tfoot id='IkjgO'></tfoot>
      2. <legend id='IkjgO'><style id='IkjgO'><dir id='IkjgO'><q id='IkjgO'></q></dir></style></legend>
      3. <small id='IkjgO'></small><noframes id='IkjgO'>

        如何使 APC(PHP 缓存)工作?

        时间:2024-04-13
          <tbody id='O1Uaj'></tbody>
          <legend id='O1Uaj'><style id='O1Uaj'><dir id='O1Uaj'><q id='O1Uaj'></q></dir></style></legend>
            • <bdo id='O1Uaj'></bdo><ul id='O1Uaj'></ul>
              <i id='O1Uaj'><tr id='O1Uaj'><dt id='O1Uaj'><q id='O1Uaj'><span id='O1Uaj'><b id='O1Uaj'><form id='O1Uaj'><ins id='O1Uaj'></ins><ul id='O1Uaj'></ul><sub id='O1Uaj'></sub></form><legend id='O1Uaj'></legend><bdo id='O1Uaj'><pre id='O1Uaj'><center id='O1Uaj'></center></pre></bdo></b><th id='O1Uaj'></th></span></q></dt></tr></i><div id='O1Uaj'><tfoot id='O1Uaj'></tfoot><dl id='O1Uaj'><fieldset id='O1Uaj'></fieldset></dl></div>

              <small id='O1Uaj'></small><noframes id='O1Uaj'>

              • <tfoot id='O1Uaj'></tfoot>

                • 本文介绍了如何使 APC(PHP 缓存)工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我读过关于 APC 的文章,它可以加速多个 php 文件站点.所以我在 PHP 中有一个包含许多文件的特定项目,我发现 require_once 和只解析类定义(不执行它们)需要大部分时间.

                  I've read about APC that it speeds up multiple php file sites. So I have this particular project in PHP with many files and i discover that require_once and parsing only class definitions (without executing them) takes most time.

                  所以我在我的 CentOS 5 服务器上安装了 APC.我将 apc.php 移动到我的网络服务器并显示

                  So I've installed APC on my CentOS 5 server. I moved apc.php to my webserver and it displays

                  Hits: 1 (50.0%)
                  Misses: 1 (50.0%)
                  
                  Cached Files    1 (281.1 KBytes)
                  

                  我可以去网站更改子页面等等,apc.php仍然只显示一个缓存文件??

                  And I can go to website and change subpages and so on, and apc.php still shows only one cached file ??

                  在 phpinfo() 中显示:

                  And in phpinfo() it shows that:

                  APC 支持启用

                  我不知道该怎么办.APC 是否正常工作(如 phpinfo() sais)?浏览我网站的某些页面后,只有一个缓存文件并不多.

                  I don't know what to do. Is APC working (like phpinfo() sais) or is it not? Only one cached file is not much after browsing some pages on my website.

                  还有更多如何诊断错误并确保 APC 正常工作?我浏览过

                  And further more how to diagnose errors and make sure that APC works? I've browsed

                  apc.mmap_file_mask/tmp/apc.QnLqNf/tmp/apc.QnLqNf

                  apc.mmap_file_mask /tmp/apc.QnLqNf /tmp/apc.QnLqNf

                  目录/tmp 但我没有任何像 phpinfo 中所述的 apc 文件.

                  Directory /tmp but I don't have any files of apc there like it's stated in phpinfo should occur.

                  请帮我检查 APC 是否正常工作,如果没有,可能是什么问题.

                  Please help me check if APC is working and if not, what can be a problem.

                  推荐答案

                  APC 可以两用方式:

                  1. 作为操作码缓存.您启用了支持,所以这是有效的;和
                  2. 作为一般缓存.为此,您必须明确使用 API.

                  (1) 是主要的好处.它通过存储编译"脚本的操作码结果来减少脚本执行的时间.

                  (1) is the main benefit. It reduces time for script execution by storing the opcode results of "compiling" scripts.

                  至于它的工作原理,来自 安装说明:

                  As for it working, from the installation instructions:

                  注意:在 Windows 上,APC 需要一个临时路径才能存在,并且可由网络服务器.它检查 TMP、TEMP、USERPROFILE 环境变量在该命令,最后尝试WINDOWS 目录,如果这些都不是设置.

                  Note: On Windows, APC needs a temp path to exist, and be writable by the web server. It checks TMP, TEMP, USERPROFILE environment variables in that order and finally tries the WINDOWS directory if none of those are set.

                  所以你不应该在 CentOS 上需要它(或查看任何活动).

                  So you shouldn't need it (or see any activity) on CentOS.

                  话虽如此,require/include 比 require_once/include_once/autoload 更好,但只有在处理数百个文件时才有意义.

                  That being said, require/include are better than require_once/include_once/autoload but it should only matter if you are doing that with hundreds of files.

                  这篇关于如何使 APC(PHP 缓存)工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:PHP邮件功能在Centos服务器上不起作用 下一篇:如何让 PHP 能够读取系统环境变量

                  相关文章

                    <small id='dguHr'></small><noframes id='dguHr'>

                    <i id='dguHr'><tr id='dguHr'><dt id='dguHr'><q id='dguHr'><span id='dguHr'><b id='dguHr'><form id='dguHr'><ins id='dguHr'></ins><ul id='dguHr'></ul><sub id='dguHr'></sub></form><legend id='dguHr'></legend><bdo id='dguHr'><pre id='dguHr'><center id='dguHr'></center></pre></bdo></b><th id='dguHr'></th></span></q></dt></tr></i><div id='dguHr'><tfoot id='dguHr'></tfoot><dl id='dguHr'><fieldset id='dguHr'></fieldset></dl></div>

                    • <bdo id='dguHr'></bdo><ul id='dguHr'></ul>
                    <tfoot id='dguHr'></tfoot>
                    1. <legend id='dguHr'><style id='dguHr'><dir id='dguHr'><q id='dguHr'></q></dir></style></legend>