禁用或删除APC [英] Disable or remove apc

查看:156
本文介绍了禁用或删除APC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的Ubuntu 11.04安装Linux APC和我想要做一些性能基准,看看有什么在PHP的速度没有提高,但APC,我不知道如何禁用/删除APC。

我试图清空我apc.ini文件,但它并没有奏效。我打开一个页面,第一次还是以后,页面将被保存在缓存和我第二次加载页面,它加载速度更快。

下面是我用来测量时间的PHP文件。

 < PHP
    功能的getTime()
        {
        $ A =爆炸('',microtime中());
        回报(双)$ A [0] + $ A [1];
        }
    $开始=的getTime();
    ?>
    < PHP require_once(包括/ connection.php);?>
    < PHP require_once(包括/的functions.php);?>
    < PHP
        find_selected_pa​​ge(真);
    ?>
    < PHP require_once(包括/ header.php文件);?>        <表ID =结构>
            &所述; TR>
                < TD ID =导航>
                    <?PHP的回声navigation_public($ sel_subject,真正的);
                      // $ sel_page发送作为一个全球性,使我们可以重新使用在页面区域
                    ?>
                < / TD>
                < TD ID =页>
                    < PHP                        如果($ sel_page!= NULL)
                        {
                            回声&所述; H2>中ヶ辆($ sel_page ['MENU_NAME'])。&下; / H2>中;
                            回声\"<p>\".strip_tags(nl2br($sel_page['content']),\"<b><br><p><a>\").\"</p>\";
                        }
                        否则,如果($ sel_subject!= NULL)
                        {
                            回声&所述; H2&gt;中$ sel_subject ['MENU_NAME']。&下; / H2&gt;中;
                        }
                        其他
                        {
                            回声&LT; H2&GT;欢迎窗口小部件公司与LT; / H2&gt;中;
                        }
                    ?&GT;
                &LT; / TD&GT;
            &LT; / TR&GT;
        &LT; /表&gt;
        &LT; PHP
    $结束=的getTime();
    回声所用时间=.number_format(($结束 - $开始),3)秒。
    ?&GT;
    &LT; PHP的要求(包括/ footer.php);?&GT;


解决方案

修改

 扩展= apc.so

方式:

 ;延长= apc.so

  /etc/php5/apache2/conf.d/apc.ini

和重新启动Apache服务器:

  apache2ctl优美

I installed APC on my ubuntu 11.04 linux and I want to make some performance benchmarks to see what's the speed improvement over PHP without APC but I don't know how to disable/remove the APC.

I tried to empty my apc.ini files but it didn't worked. Still after I load a page for the first time, the page will be stored in the cached and the second time I load the page, it loads much faster.

Here's a PHP file that I use to measure the time.

<?php 
    function getTime() 
        { 
        $a = explode (' ',microtime()); 
        return(double) $a[0] + $a[1]; 
        } 
    $Start = getTime(); 
    ?>
    <?php require_once("includes/connection.php");?>
    <?php require_once("includes/functions.php");?>
    <?php
        find_selected_page(true);   
    ?>
    <?php require_once("includes/header.php");?>

        <table id="structure">
            <tr>
                <td id="navigation">
                    <?php echo navigation_public($sel_subject,true);
                      //            $sel_page is sent as a GLOBAL   so that we can reuse is in the page area
                    ?>
                </td>
                <td id="page">
                    <?php

                        if($sel_page!=NULL)
                        {
                            echo "<h2>".htmlentities($sel_page['menu_name'])."</h2>";
                            echo "<p>".strip_tags(nl2br($sel_page['content']),"<b><br><p><a>")."</p>";
                        }
                        else if($sel_subject!=NULL) 
                        {
                            echo "<h2>".$sel_subject['menu_name']."</h2>";
                        }
                        else 
                        {
                            echo "<h2>Welcome to Widget Corp</h2>";
                        }
                    ?>
                </td>   
            </tr>   
        </table>    
        <?php 
    $End = getTime(); 
    echo "Time taken = ".number_format(($End - $Start),3)." secs"; 
    ?>
    <?php require("includes/footer.php");?>

解决方案

Change :

extension=apc.so

By :

;extension=apc.so

In :

/etc/php5/apache2/conf.d/apc.ini

And restart Apache server :

apache2ctl graceful

这篇关于禁用或删除APC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆