Nội dung
In today’s article, AZDIGI will show you how to enable OPCache on aaPanel. For the purpose of reducing CPU load and speeding up the website.
I. Overview
By default, when installing aaPanel on your VPS/Server, aaPanel will only install 1 version of PHP. If you install many new versions of PHP, there will also be a backlog problem in that all the new PHP versions you install do not have Opcache PHP Extension built-in. So what is Opcache PHP Extension? Please continue reading this article.
II. What is OPCache?
Originally called Zend Optimizer +, Zend OPcache (introduced in PHP 5.5.0) is a powerful PHP extension built to enhance PHP performance, thus increasing overall application performance. It is available as an extension through PECL for PHP versions 5.2, 5.3 and 5.4. It works by storing precompiled script-bytecode in shared memory or RAM, thus eliminating the need for PHP to load and parse the script on each request.
Benefits OPcache brings:
- Helps reduce %CPU usage for the server.
- Reduce TTFB of all PHP sites on the server.
- Increase website loading speed.
So how to enable Opcache on aaPanel? Please see the following steps.
III. How to enable OPCache on aaPanel
To enable OPCache on aaPanel, we do the following 2 steps:
Step 1: Access your aaPanel admin interface
To access aaPanel, we access the path of the form http://IP:8888
(replace IP with the IP of your aaPanel server)
After accessing the aaPanel interface, we continue to step 2.
Step 2: Enable OPCache on your PHP
I use two PHP versions, 7.3 and 5.6, so I will do it with PHP 7.3 first.
At the aaPanel interface, we click on PHP 7.3.
Next, click the Install Extensions feature as shown below:
Here, find OPCache and click the Install button at the end of the line.
Here, find OPCache and click the Install button at the end of the line.
You wait a moment for the installation process to complete and display the log as shown above. Similar to PHP 5.6 version, I also do the same.
Since PHP 5.6 is the default PHP version when executing PHP commands over SSH after successfully installing OPCache, check the PHP version you will see as below. The above paragraph is before installing OPCache and the following is after installing OPCache.
So we have completed the steps to enable OPCache on aaPanel. After installing OPCache, you notice that the CPU usage has decreased significantly, from which we can add more websites on this aaPanel server.
IV. Summary
Hopefully, through this article, you already know what OPCache is and its effects, as well as how you can enable OPCache on your aaPanel.
Hope this article will be of help to you. Wishing you success!
See more useful articles about aaPanel at the following link:
If you need assistance, you can contact support in the ways below:
- Hotline 247: 028 888 24768 (Ext 0)
- Ticket/Email: You use the email to register for the service and send it directly to: support@azdigi.com