The MU forums have moved to

How To Install APC On Ubuntu Apache2 PHP5 (9 posts)

  1. honewatson
    Posted 16 years ago #

    Well I hope this helps somebody with the installation process of APC if you need to optimize your Mu.

    This is what worked for me on Ubuntu Feisty Apache2 PHP5 (maybe it will work on debian too):

    1. apt-get update
    2. apt-get install apache2-dev php5-dev php-pear make
    3. ln -s /usr/bin/apxs2 /usr/bin/apxs
    4. pecl install apc
    5. Edit the /usr/share/php/pearcmd.php, and add:

      @ini_set('memory_limit', '128M');

    6. Add this to /etc/php5/apache2/php.ini
      apc.filters = wp-cache-config

    7. /etc/init.d/apache2 restart
  2. blogono
    Posted 15 years ago #

    i tried to install apc but i am not sure if i did it right.

    here is my phpinfo-file ...

    does anybody know if it is installed correctly?

  3. jamescollins
    Posted 15 years ago #

    Hi blogono,

    There is no apc section in your phpinfo output, so it looks like it isn't installed correctly.

    Did you restart apache after installing APC?

  4. blogono
    Posted 15 years ago #

    hi james,
    thx for your help!

    i was following this tutorial ...



    i have done the following .....

    used putty to grap apc 3.0.19, extract & put it in /usr/local/src

    cd /usr/local/src/APC-3.0.19


    ./configure --enable-apc --enable-apc-mmap --with-apxs=/usr/local/apache/bin/apxs --with-php-config=/usr/bin/php-config


    make install

    -> in usr/lib/php.ini put "extension="/usr/lib/php/extensions/no-debug-non-zts-20020429/"
    apc.shm_size = 32" before ";Windows Extensions"

    -> save php.ini & restarted apache

    /etc/rc.d/init.d/httpd stop
    /etc/rc.d/init.d/httpd start


    (and now with: service httpd restart - to make sure)

    but it seems like not being installed.

    is there anything missing in the tutorial i have posted? how can i get the error-log-file for httpd?

    error code at apc.php is "No cache info available. APC does not appear to be running."

  5. jamescollins
    Posted 15 years ago #


    What linux distribution are you running?

    I used the following to install APC on our CentOS servers:
    $yum install php-devel
    $yum install httpd-devel
    $pecl install apc
    this installed APC v3.0.18
    Enabled it by adding the following to /etc/php.ini:
    #APC cache
    # exclude kses.php because it segfaults:
    apc.filters = "kses\.php"
    then restarted apache.
  6. blogono
    Posted 15 years ago #

    thank you for your help!!! it is CENTOS Enterprise 5.2 i686

    i tried ..

    $yum install php-devel
    $yum install httpd-devel
    $pecl install apc

    .. as you suggested, but at first line i get error at the end of process "thread.error: cant start new thread"

    could you perhaps help me and install it??

  7. lunabyte
    Posted 15 years ago #

    Just throwing this out there, but I've seen better performance across my servers after switching from APC to xCache.

    It also doesn't have the problems with other files, like kses.php for example.

  8. blogono
    Posted 15 years ago #

    hi lunabyte,
    thax for your suggestion.

    i have now installed xcache and it is working.

    but unfortunately, my pages do not load completely -> footer part or adminbar are always missing. do you know whats wrong?

    here my config in php.ini ...

    ;; install as zend extension (recommended)
    zend_extension = /usr/local/lib/php/extensions/no-debug-non-zts-somenumber/
    ;; install as zend extension with thread-safe
    ; zend_extension_ts = /usr/local/lib/php/extensions/non-debug-zts-xxx/
    ;; install as PHP extension (extension_dir must be set to the full path to
    ; extension =

    xcache.admin.user = “admin”
    xcache.admin.pass = "somepass"

    xcache.shm_scheme = “mmap”
    xcache.size = 64M
    xcache.count = 1
    xcache.slots = 8K
    xcache.ttl = 0
    xcache.gc_interval = 0

    xcache.var_size = 0M
    xcache.var_count = 1
    xcache.var_slots = 8K
    xcache.var_ttl = 0
    xcache.var_maxttl = 0
    xcache.var_gc_interval = 300

    xcache.test = Off
    xcache.readonly_protection = Off
    xcache.mmap_path = “/dev/zero”
    xcache.coredump_directory = “”
    xcache.cacher = On
    xcache.stat = On
    xcache.optimizer = Off

    xcache.coverager = Off
    xcache.coveragedump_directory = “”

  9. blogono
    Posted 15 years ago #

    it is very weird, that it does not load the full page. does anybody else have this problem?

    its seems like xcache does affect php, i can not access pathinfo anymore



    the redirection to the signup-page when you enter an available blog-url



About this Topic

  • Started 16 years ago by honewatson
  • Latest reply from blogono