Linux Mint + How To Install APC And Configure APC On Xampp – APC caching extension

To install APC (APC caching extension) for Xampp on your Linux Mint or Ubuntu distro, just follow the steps below:

  1. # cd apc (to your apc folder you just extracted)
  2. # sudo /opt/lampp/bin/phpize
  3. # ./configure –enable-apc –with-apxs –with-php-config=/opt/lampp/bin/php-config
  4. # make
  5. # sudo make install
  6. Next Step is to edit you php.ini and add the apc extension as follows:extension=apc.so

How To Configure APC In php.ini ?

I have been pretty comfortable with the following APC Settings so far with version PHP 5.3.2+ (I haven’t tested with lower PHP version)

In your php.ini, just add the following block:
NOTE:
=> There should be only one line of extension=apc.so
=> So either delete the one you added above, or remove the one in the block below.. your choice, but I prefer the one below, to keep things grouped by modules/extensions

[apc]
extension=apc.so
apc.enabled = 1
apc.shm_segments = 1
apc.shm_size = 32M
apc.optimization = 0
apc.num_files_hint = 512
apc.user_entries_hint = 1024
apc.ttl = 0
apc.user_ttl = 0
apc.gc_ttl = 600
apc.cache_by_default = 0
apc.filters = “apc\.php$”
apc.slam_defense = 0
apc.use_request_time = 1
apc.mmap_file_mask = /tmp/apc.XXXXXX
apc.file_update_protection = 2
apc.enable_cli = 0
apc.max_file_size = 2M
apc.stat = 0
apc.write_lock = 1
apc.report_autofilter = 0
apc.include_once_override = 0
apc.rfc1867 = 0
apc.rfc1867_prefix = “upload_”
apc.rfc1867_name = “APC_UPLOAD_PROGRESS”
apc.rfc1867_freq = 0
apc.localcache = 1
apc.localcache.size = 512
apc.coredump_unmap = 0
apc.stat_ctime = 0

Possible Errors During Execution Of phpize

If You Appreciate What I Do Here On Seven PHP :: 7PHP, You Could Consider:

  1. Following me on Twitter | @7php
  2. LIKE-ing my FaceBook page
  3. Subscribe to my Email List - see top-right subscription box
  4. Help diffuse this interview to the PHP ecosystem - Share & Spread the word as far as you can ==> That would be a FREE way to thank me
  5. Use my DigitalOcean referral link if you plan to use it as your VPS (it starts at only $5/month btw) or if you can refer it to your friends, highly appreciated.
  6. Support via Paypal donate - my Paypal ID is w@7php.com

{I'm thankful to your response(s)!}

Valuable Feedback / Comment / Review From People Like You

  1. not sure what you mean by
    1.# cd apc (to your apc folder you just extracted)

  2. Hi Ken,
    thanks for your comment.

    By cd apc I mean to change your directory to APC. That is go to your APC folder.

    I don’t know how more simpler I can explain that :S But if you still have confusion, let me know what is not clear. I will then see how I can clarify it better.

    Thanks,
    //Wasseem

  3. Hey great, it’s works
    thank’s to post the “Possible Errors”
    cause i catch them in my machine

  4. Hi Aditya,
    thanks for your comment, glad I have been helpful :)

    //Wasseem

  5. Hi, I can’t get it work, I tried to install APC 3.1.9 (latest stable version) but when I ran phpize it showed some warnings like config.m4:180: warning: AC_CACHE_VAL(PHP_APC_GCC_ATOMICS, …): suspicious cache-id, must contain _cv_ to be cached
    When I continued with ./configure it said:
    configure: WARNING: you should use –build, –host, –target
    configure: WARNING: invalid host type: –enable-apc
    configure: WARNING: you should use –build, –host, –target
    configure: WARNING: invalid host type: –with-apxs
    configure: error: invalid variable name: `–with-php-config’

    Any thought?

Speak Your Mind

*