APC gives our server a huge performance boost. It is a free and robust framework for caching and optimizing PHP intermediate code.
The installation steps are given below :
1. Login to the server as root
2. Download APC. You will get the latest tar file from the site http://pecl.php.net/package/apc
3. Extract and move into the directory
cd APC-3.0.14
4. Locate the location of phpize
It should look like:
phpize: /usr/bin/phpize
5. Run the same whereis command for php-config and apxs. Next type:
6. Compile APC
make
make install
The “make install” command will return the location of the apc.so extension. Note down the location as we need it later.
7. Install APC into php.ini. For that we need to edit php.ini and add the APC extension.
vi /usr/local/lib/php.ini
Add the following lines in php.ini
extension=apc.so
apc.enabled=1
apc.shm_segments=1
apc.shm_size=128
apc.ttl=300
apc.user_ttl=300
apc.num_files_hint=1024
apc.mmap_file_mask=/tmp/apc.XXXXXX
apc.enable_cli=1
apc.stat = 1
apc.rfc1867=1
apc.rfc1867_prefix=”upload_”
apc.rfc1867_name=”APC_UPLOAD_PROGRESS”
apc.rfc1867_freq=”100k”
8. Restart Apache
You can check whether APC is successfully installed by checking the phpinfo page.