The MU forums have moved to WordPress.org

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

  1. honewatson
    Member
    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

      extension=apc.so
      apc.filters = wp-cache-config

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

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

    here is my phpinfo-file ...

    http://blogono.com/phpinfo.php

    does anybody know if it is installed correctly?

  3. jamescollins
    Member
    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
    Member
    Posted 15 years ago #

    hi james,
    thx for your help!

    i was following this tutorial ...

    http://www.vbulletin.com/forum/showthread.php?t=165367

    ..

    -----------------------------------------------

    i have done the following .....

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

    2.
    cd /usr/local/src/APC-3.0.19

    3.
    /usr/bin/phpize

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

    5.
    make

    6.
    make install

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

    8.
    -> 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."

    http://blogono.com/apc.php

  5. jamescollins
    Member
    Posted 15 years ago #

    Hi,

    What linux distribution are you running?

    I used the following to install APC on our CentOS servers:

    http://carroll.org.uk/archives/2006/02/02/alternative-php-cache-apc-on-debian
    
    $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
    extension=apc.so
    # exclude kses.php because it segfaults:
    http://quentin.unblog.fr/wordpress-mu-wpmu/wpmu-caching/php-opcode-cache-and-wpmu/
    apc.filters = "kses\.php"
    
    then restarted apache.
  6. blogono
    Member
    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??
    blogono[@]gmail.com

  7. lunabyte
    Member
    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
    Member
    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 ...

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

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

    [xcache]
    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]
    xcache.coverager = Off
    xcache.coveragedump_directory = “”

  9. blogono
    Member
    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

    eg
    http://blogono.com/pathy.php

    or

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

    eg
    http://newblog.blogono.com

    http://

About this Topic

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