Opcache is a built-in PHP accelerator included in PHP 5.5 and above. By default, it is disabled, but enabling it and properly setting it up can provide great benefits to your website’s speed as long as it makes use of PHP. Opcache does not work with the suPHP handler; if you wish to use Opcache, it is recommended you use the DSO PHP handler.
To begin using Opcache, the first thing you must do is log into WHM and find EasyApache. You can do this easiest by typing “EasyApache” into the search bar; the only result will be the option you require.
Once EasyApache loads, click on the gear icon of the profile you are using to customize the setting.
Click on “Next Step” until you can get to the “Exhaustive Options List”.
Under this list, find “Opcache” under the PHP 5.5.28 section. Click on the button to activate it. When you do, you’ll receive a warning that it is incompatible with XCache. Click OK.
At the bottom of the page, click Save and Build.
You will be asked if you wish to Build and Recompile Apache. Click yes.
Once you do, you should not under any circumstances stop the process, as it will cause a corruption requiring a full restore of your server. Once everything is recompiled, Opcache will now be active.
Before Opcache will begin working, you must manually set up Opcache by editing your php.ini file manually. Installing Opcache will put the following at the bottom of your php.ini file:
You can enable the default settings by removing the ; from each line. Editing your php.ini file may require you to have root-level SSH access to your server. You can see our guide on how to set it up. If you do not wish to have this access, a support ticket to our MST can help. They can change the settings for you.
If you wish, you can install a GUI (graphical user interface) to make working with Opcache easier. One simple choice is opcache-wgui, which you can find here. Simply download the index.php file from that git and then upload it to your server in whatever location you choose. Once it’s uploaded, you simply navigate to the directory it is in and you’ll see this:
This shows the current settings. Each setting is also a link that, when clicked, takes you to documentation for that setting.
There are other GUI options as well, but they may be more difficult to install and contain more complicated functions.