Installing APC Cache (alternative to Turck Mmcache/Eaccelerator)

Notes on installing Alternative PHP Cache (APC):

  1. Download and istall:
    $ wget http://pecl.php.net/get/APC-3.0.14.tgz
    $ tar -xvzf APC-3.0.14.tgz
    $ cd APC-3.0.14
    $ phpize
    $ ./configure --enable-apc
    $ make
    # make install
  2. Add the below lines to the php.ini:
      extension=/path/to/apc.so
      apc.enabled=1
      apc.shm_segments=1
      apc.optimization=0
      apc.shm_size=128
      apc.ttl=7200
      apc.user_ttl=7200
      apc.num_files_hint=1024
      apc.mmap_file_mask=/tmp/apc.XXXXXX
      apc.enable_cli=1
  3. Restart apache:
    # service httpd restart
  4. Check phpinfo() to see if APC is enabled.
  5. Copy the "apc.php" admin file in the source directory to a password protected web site directory. Edit "apc.php" top line to change password to something different from default.

Related Links:

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
I just go through given

I just go through given instruction but phpinfo() doesn't showing me APC installed. I added extension=/path/to/apc.so
apc.enabled=1
apc.shm_segments=1
apc.optimization=0
apc.shm_size=128
apc.ttl=7200
apc.user_ttl=7200
apc.num_files_hint=1024
apc.mmap_file_mask=/tmp/apc.XXXXXX
apc.enable_cli=1
this lines at the end of the php.ini is i am correct? Give me solution

apc.so path

Did you replace "/path/to/apc.so" with the actual path to the "apc.so" lib file? Alternately, you could just use "extension=apc.so".

pcre-devel

pcre-devel package is required on CentOS

APC and Zend Optimizer not compatible together

APC and Zend Optimizer does not play well together. Apache crashes with segmentation fault trying to allocated huge amounts of memory.

eAccelerator and Zend Optimizer are compatible.

phpize

bash: phpize: command not found

I get this error following your guide (Ubuntu Dapper Drake Server)

dev package for phpize

You will need to install the dev package for php.

Comment