Sunday, January 2, 2011

Installing PHP APC on Linux

APC or Alternative PHP Cache in an open source framework for caching, what APC do it basically parse you PHP files into an efficient binary format so that when ever a page is requested it does parse by the PHP parser again and again, by doing so we basically reduce time to load a page and increase our efficiency.
Installation of APC can be very tricky and simple as well (for me it was tricky :) ), to install APC on you server you must have the access of root, and if your server is on some remote location you must have putty to communicate with the server.
Are you ready to go with the putty? OK good , lets start our installation, First we need to download APC issue the command.
$ wget http://pecl.php.net/get/APC
it will download a file APC-3.0.16.tgz which is the latest version yet, now we extract the file
$ tar -zxf APC-3.0.16.tgz
change the directory
$ cd APC-3.0.16
next we required PHP development packages, if you have it then its great if not then install it too
yum install php-devel
then issue a commad
$ phpize
now run the configuration for APC by issuing the command
./configure --enable-apc --enable-apc-mmap --with-apxs --with-php-config=/usr/bin/php-config
here you must know where is the php-config file is, if you do not know it locate it using $ whereis php-config and assign it to --with-php-config parameter, now we need to make the packages, we have to issue two more command
$ make
$ make install
and then we have to restart the server to make it to use latest PHP configuration, to restart apache, issue following command
/etc/init.d/httpd restart
to make sure it is install correctly copy the below mention script and put in a file say, phpinfo.php and run it
<php
phpinfo();
?>
APC comes with a file apc.php copy that file in the root of your website and run it, http://www.example.com/apc.php , you will be able to a see a page similar to this, you can also password protect it.
Installing PHP APC on Linux

0 comments:

Post a Comment

 

Blog Info

A Pakistani Website by Originative Systems

Total Pageviews

Tutorial Jinni Copyright © 2015 WoodMag is Modified by Originative Systems