PHP: APC Configuration and Usage Tips and Tricks Part 2

This PHP APC guide is divided on four different section:
1. PHP APC Configuration
2. Enable PHP APC Statistics
3. Howto Use PHP APC User Cache
4. PHP APC Performance Testing

2. Enable PHP APC Statistics

This is important part, if you want to see some statistics how APC Cache is working.

2.1 Find apc.php File


updatedb

locate apc.php

Example location on Fedora/CentOS/RHEL /usr/share/doc/php-pecl-apc-3.1.10/apc.php.

2.2 Make apc.php File Public

Here you can use create new virtual host for APC statictics or just copy apc.php file under some existing virtual host.

2.3 Configure apc.php File

Modify at least following settings:


defaults('USE_AUTHENTICATION',1);
defaults('ADMIN_USERNAME','your-user-name'); // Admin Username
defaults('ADMIN_PASSWORD','your-password'); // Admin Password - CHANGE THIS TO ENABLE!!!

2.4 Check APC Statistics

Open apc.php on your browser to see statistics. Your statisticss url could be example http://stats.your-domain.com/apc.php.

PHP APC Statictics Screenshot (APC 3.1.10, PHP 5.3.14, Nginx 1.2.2)
PHP APC Opcode Cache Statistics Screenshot

This PHP APC guide is divided on four different section:
1. PHP APC Configuration
2. Enable PHP APC Statistics
3. Howto Use PHP APC User Cache
4. PHP APC Performance Testing

40 comments on “PHP: APC Configuration and Usage Tips and Tricks Part 2

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Close