Monitoring APC Cache in PHP

Kiran Maniya
2 min readDec 5, 2019

--

I recommend you use the apc.php script, which is part of the official APCu — APC User Cache repository. It’ll give you simple, yet meaningful data

If you already have APC installed and running, the first step is to install the APC monitoring script. Assuming your webroot is at /var/www/, you can easily install it as given.

First, copy the script to your web root using the command cp /usr/share/doc/php-apc/apc.php.gz /var/wwwthen, decompress it by gzip -d /var/www/apc.php.gz . Now you will be able to access the monitoring script. If you want, you can also download the script from the Official Repository and place it inside the webroot. It will give you an interface similar to the given below,

APC Monitor Dashboard

The script comes with the default login. If you want to login the admin interface, you will need to change the admin password. Find the password constant definition from the script and put your own. Refresh the page and you will be able to log in. For your reference, you need to change the line

defaults(‘ADMIN_PASSWORD’,’YOUR_PASSWORD_HERE’);

APC Cache Monitoring alternatives

If you are looking for more advanced option to manage the APC cache, there are other, more advanced options, that were mostly built for APC monitoring back in the day. Obviously they aren’t so relevant for APCu, but watch these projects regardless as they might evolve:

--

--