How do I manage the APC cache?

Procédure

What is APC cache?

The APC extension(AlternativePHPCache) is an advanced caching system that speeds up the generation of your PHP pages and saves work on the server. It's called an OPCode cache.

In simple terms, OPCode is the intermediate code compiled by PHP to execute your pages. An OPCode cache means that you no longer have to systematically 'compile' each page you call up, by providing a page that has already been compiled and stored in your server's RAM.

How do I set up APC?

APC is already installed on all our VPS servers, so you don't need to install it.


How do I check that APC is active?

You can check that the APC module is active by using a phpinfo

To do this, create a php file with this line :

phpinfo();


Then insert this file in the root of your website.

You should obtain a page indicating the PHP configuration of your server.

How do I manage the APC cache?

You can now check that APC is available and activated.

How do I manage the APC cache?


How do I delete data from the cache?

You can manage the APC interface by copying the file from the APC documentation (Replace {your website} with the name of your site)

cp /usr/share/doc/php-apc/apc.php /var/www/{yourwebsite}/web/

You can then go to the APC interface via this page

http://nom_de_votre_site/apc.php

How do I manage the APC cache?


From this interface, you can check the cached files by clicking on the

"User Cache Entries" button and purge cached files using the"Clear User cache" button.

How do I manage the APC cache?
If you are unable to register, you need to edit the apc.php file

/var/www/{your website}/web/apc.php


Then modify these two lines with a username and password of your choice

Before modification

defaults('ADMIN_USERNAME','apc'); // Admin Username defaults('ADMIN_PASSWORD','password'); // Admin Password - CHANGE THIS TO ENABLE!!!!


After modification

defaults('ADMIN_USERNAME','apclws'); // Admin Username defaults('ADMIN_PASSWORD','passwordlws'); // Admin Password - CHANGE THIS TO ENABLE!!!


How do I disable APC cache?

To disable it, you need to find the APC configuration file.

To do this, use PHP INFO.

How do I manage the APC cache?


You need to edit this file:

nano /etc/php5/fpm/conf.d/20-apc.ini


Modify this configuration file using ";" to comment out these instructions.


1. Edit the file

2. Comment on the file

Before

extension=apc.so


After

extension=apc.so


You can also remove this package completely

sudo aptitude remove php-apc sudo pecl uninstall apc

help.lws.net/a/354
Was this article helpful?

Yes

No

Read 22 503 times

Thank you! Feel free to ask questions about our documentation if you would like more information, and help us improve it.

Similar articles

A question about this article?

Ask the LWS team and the community. Answers are published after moderation.

Ask the LWS team and its community a question

GDPR: Controller: LWS-Ligne Web Services. Purpose: moderation and public publication of your question, possible notification of an answer. Legal basis: consent (Art. 6(1)(a) GDPR). Email retention: 90 days after notification, 12 months maximum without an answer. To exercise your rights, see the GDPR section of our Terms and Conditions.