Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable or remove apc

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");?>
like image 462
Dragos C. Avatar asked Jul 03 '12 11:07

Dragos C.


3 Answers

Change :

extension=apc.so

By :

;extension=apc.so

In :

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

And restart Apache server :

apache2ctl graceful
like image 78
fsenart Avatar answered Sep 22 '22 01:09

fsenart


You can enter the following command with root permission:

pecl uninstall apc
like image 40
Cheetah Avatar answered Sep 26 '22 01:09

Cheetah


apc.enabled can be set to 0 to disable APC from php.ini Than restart your web server or php-fpm.

like image 32
osm Avatar answered Sep 26 '22 01:09

osm