Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: Installing Alternative PHP Cache (APC) on Server  (Read 7880 times)

0 Members and 1 Guest are viewing this topic.

sajugovind

  • Guest
Installing Alternative PHP Cache (APC) on Server
« on: April 06, 2014, 07:03:02 pm »
Installing APC on your Virtual Private Server

The APC-Alternative PHP Cache is a free, open, and robust framework that is responsible for caching and optimization of PHP.

Steps to Install APC on your web server:

Step i – You must be logged in as root to proceed with installing APC on your server

Step ii – You must then download the APC

   
Code: [Select]
wget http://pecl.php.net/package/APC
eg : wget http://pecl.php.net/get/APC-3.0.15.tgz

Step iii – Having done that, you are then required to extract it over your Web Hosting UK server:

 
Code: [Select]
   tar -xzf APC-3.0.15.tgz

    cd APC*

Step iv – Look for the PHP location by running the below command :

   
Code: [Select]
which php
You must remember the location displayed in the result.

Step v – Now you need to proceed with creating the configuration files using the below command :

Code: [Select]
    phpize
Step vi – Now the APC need to be compiled over the server :

 
Code: [Select]
  ./configure –enable-apc –enable-apc-mmap –with-apxs –with-php-config=/usr/local/bin/php-config
    make
    make install

Note : You must install the APC in the php.ini file

Step vii – Run the below command to find the php.ini over the server :

   
Code: [Select]
php -i | grep php.ini
Step viii – Amend php.ini by adding APC extension, as stated below :

   
Code: [Select]
vi /usr/local/Zend/etc/php.ini
Step ix – Add the following to the php.ini file :

   
Code: [Select]
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

Step x – Finally, you must restart Apache using the below command :

   
Code: [Select]
service httpd restart
Thank you,