Site/App Performance

Enabling Opcache for PHP 5.5 and above through cPanel

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.

Enabling
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.

Screen Shot 2015-09-09 at 1.45.25 PM

Once EasyApache loads, click on the gear icon of the profile you are using to customize the setting.

Screen Shot 2015-09-09 at 1.46.17 PM copy

Click on “Next Step” until you can get to the “Exhaustive Options List”.

Screen Shot 2015-09-09 at 1.47.35 PM

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.

Screen Shot 2015-09-09 at 1.52.30 PM

Screen Shot 2015-09-09 at 1.52.12 PM

At the bottom of the page, click Save and Build.

Screen Shot 2015-09-09 at 1.53.17 PM

You will be asked if you wish to Build and Recompile Apache. Click yes.

Screen Shot 2015-09-09 at 1.54.08 PM

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.

Setup
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:

; opcache.memory_consumption=128
; opcache.interned_strings_buffer=8
; opcache.max_accelerated_files=4000
; opcache.revalidate_freq=60
; opcache.fast_shutdown=1
; opcache.enable_cli=1

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.

GUI Installation
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:

Screen Shot

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.

Find out more about ServInt solutions

Starting at $25

  • Hosting Advice
  • The New York Times
  • The Hill
  • Bloomberg
  • The Seattle Times
  • Computer World
  • Ars Technica
  • MSNBC

To engage with the ServInt Sales Team use the following chat icon. Normal sales hours are Monday-Friday 9am-5pm EST but feel free to leave a message and we will follow up as soon as possible.

Sales Chat



To engage with the ServInt Support Team you must be logged into our Customer Portal for identity verification and have a ticket opened about your request or there will only be limited support offered.

Support Chat

CLOSE