How to Enable APC/APCu Caching in cPanel

Updated on May 16, 2023

In its nature, PHP is pretty fast, especially when it comes to PHP 8+, which is sometimes 2 times faster than PHP 7.4. All considered, caching is quite essential to the speed of any PHP application. There are different types of caching, such as APC (Alternative PHP Cache), APCu, eAccelerator, OPCache, etc. In this post, we will go over APCu - how to enable it and what its differences are from APC.

Table of Contents:

Why Enable Caching?

One of the most useful technologies available is website caching. It makes websites incredibly quick, which improves SEO rankings and user experience, as well as improved conversion rates and, consequently, higher revenue if you're selling goods or services online.

Typically, websites receive hundreds, thousands, or even millions of monthly views. Normally, the server has to do a number of complex (and time-consuming) calculations for each request from a browser for a web page. It detects the sidebar widgets for your website, produces the header and footer, and fetches the most recent entries. The outcome of all these calculations will, however, frequently be identical. Then, wouldn't it be fantastic if we could force the server to keep track of the outcome rather than handle each request individually? The exact same thing that caching does.

What is the Difference Between APC and APCu?

APC is the older version of APCu. APCu does not come with opcode cache, which is now developed and offered by OPCache. Because APCu is a user cache, your PHP code must explicitly use it in order to benefit from it, whereas OPCache starts working immediately after installation. It is best to use APCu and OPCache in conjunction.

In order to speed up a subsequent request for the same object, you can keep the outcome of an expensive action, such as reading a file or retrieving a network resource, in the user cache.

APCu's locality to the computer it runs on, as well as to the PHP process and system, is its only drawback. This implies that each PHP process will have its own cache if you run PHP as a FastCGI process.

This will be OK unless you intend to execute your application across numerous servers or processes. Memcached and Redis can be viable alternatives.

How to Enable APCu

To activate APCu caching for your account:

  • Log in to your cPanel and refer to the Select PHP Version icon under the Software section:

Find Select PHP Version in cPanel

  • From the PHP Module selector, tick the APCu option to activate the APCu PHP extension:

Tick APCu Module

  • Changes are saved automatically.

Now you should have APCu enabled and ready for caching.

Conclusion

Caching is a tool that boosts your website's speed without affecting anything else. When properly applied, it will not only lead to noticeably quicker load times but also lessen the burden on your server.

We hope you find this article useful. Discover more about FastCloud - the top-rated Hosting Solutions for personal and small business websites in four consecutive years by the HostAdvice Community!

cPanel Hosting

  • Free Domain Transfer
  • 24/7 Technical Support
  • Fast SSD Storage
  • Hack-free Protection
  • Free Script Installation
  • Free Website Transfer
  • Free Cloudflare CDN
  • Immediate Activation
View More