ecently, I’ve been experimenting with various ways to speed up a server running WordPress which had gotten very sluggish, even after enabling and fine-tuning W3TC-Cache and putting it on Cloudflare. The first step was to upgrade the whole thing to PHP7 which is its own story, but (after updating some messily coded plugins) the whole thing already got quite a bit faster. Then I experimented with mod_pagespeed which is an amazing module in its own right (and deserves its own post), installed Memcached (yet another different story), but the real performance difference came into play with OpCache.
Since it took me a while to get it up and running and I couldn’t find much documentation for this specific scenario (PHP7, Easy Apache 4, CentOS) here are the key steps for massively speeding up your server running WordPress (or any PHP application for that matter).
Installing PHP Extensions Via Easy Apache 4
- In WHM go to Home » Software » EasyApache 4 and click Customize
- Go to PHP Extensions, search for “opcache” and enable it
- Next, search for the PHP DSO handler by typing in “php70-php”. (I spent hours searching for “DSO” which didn’t bring up this result. I wish they’d rename that module so it can be found easier.)
- Click “Next” and “Provision”
- Go to Home » Software » MultiPHP Manager, bring up the PHP Handlers tab, click edit and select DSO
- Restart Apache
- Bring up phpinfo() and check if OpCache is enabled, Up and Running
- Install OpCache Status or a different GUI and fine-tune your OpCache settings by editing your php.ini or opcache.ini file (check php.ini for location)