<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 缓存)工作?

        How to make APC (PHP Cache) work?(如何使 APC(PHP 缓存)工作?)
          <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 缓存)工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)

                    <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>
                            <tbody id='dguHr'></tbody>