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

Rate this article :

3/5 | 2 opinion

This article was useful to you ?

Article utileYes

Article non utileNo

Vous souhaitez nous laisser un commentaire concernant cet article ?

Si cela concerne une erreur dans la documentation ou un manque d'informations, n'hésitez pas à nous en faire part depuis le formulaire.

Pour toute question non liée à cette documentation ou problème technique sur l'un de vos services, contactez le support commercial ou le support technique

MerciMerci ! N'hésitez pas à poser des questions sur nos documentations si vous souhaitez plus d'informations et nous aider à les améliorer.


Vous avez noté 0 étoile(s)

Similar articles

1mn reading

How do I change the SSH password for a VPS dedicated server?

1mn reading

How do I reset a dedicated VPS server?

1mn reading

How do I restart / shut down a dedicated server?

0mn reading

How do I manage my dedicated VPS server from my LWS Panel customer area?


Ask the LWS team and its community a question