APC is a Alternative PHP Cache which is a caching solution for PHP.
How APC works ?
APC reads your PHP files, parses them into a more efficient binary format and then caches them in memory so that each request for your PHP files and PHP library files can be fed from the parsed cache. This will generally lead to a speed increase when serving a PHP site, especially one with a lot of library files.
Installing APC
1) ssh the server with root user and download apc package.
2) Unpack the version and change to the APC directoryHTML Code:# cd /usr/local/src # wget http://pecl.php.net/get/APC-3.1.6.tgz
3) Create configuration files and search for the “php-config” file since you will need to configure APC with it.HTML Code:# tar -zxf APC-3.1.6.tgz # cd APC-3.1.6.tgz
4) Now, configure APCHTML Code:# phpize # which php-config
5) Create the installation files and install APCHTML Code:./configure --enable-apc --enable-apc-mmap --with-apxs --with-php-config=/usr/local/bin/php-config
Now AP installation is completed. Last step is to ad apc extension to php.ini fileHTML Code:# make # make install
6) search for php.ini file
7) Adding extensionHTML Code:# php -i | grep php.ini
HTML Code:extension="apc.so" apc.enabled=1 apc.shm_segments=1 apc.shm_size=256 apc.ttl=3600 apc.user_ttl=7200 apc.num_files_hint=1024 apc.mmap_file_mask=/tmp/apc.XXx apc.enable_cli=1
8) Save the file and restart apache service.
9) Now you should see apc extension available under phpinfo.HTML Code:#/etc/init.d/httpd restart






Reply With Quote
Bookmarks