There is no meaning if we do not write something practical commands. That part is covered. Previously we wrote step by step guides on how to install and optimize Nginx PHP5-FPM for WordPress. There is a Great Zend OPcache WordPress Visualization Plugin, Which We Will Talk About in this Article. It is Better than the Popular Standalone OPcache Visualization PHP Script. You can learn about OPcache in depth from (reading them is not prerequisite to read this guide) :
1 2 | http://jpauli.github.io/2015/03/05/opcache.html https://wiki.mikejung.biz/PHP_OPcache |
Zend OPcache WordPress Visualization Plugin : Installation of Zend OpCache
PHP 5.5 comes with OpCache out of the box. But there is a separate package as well :
1 | http://pecl.php.net/package/ZendOpcache |
If we run php -v
, we can see that OpCache is installed and the version :
---
1 2 3 4 | PHP blah blah blah Copyright (c) blah blah blah Zend Engine blah blah blah with Zend OPcache v7.0.2, Copyright (c) 1999-2013, by Zend Technologies |
The last line above shows the version of Zend OPcache. At the time of writing this guide, 7.0.5 is the latest version from the above package. In such case, we will update it. Mere running apt-get dist-upgrade
may not update it to latest. You must adjust that version number (if needed) while running the commands :
1 2 | apt-get install php-pear build-essential php5-dev sudo pecl install zendopcache-7.0.5 |
For proper working, we need to find the path of opcache.so
and add few lines in php.ini
. This is an example for the php.ini
file :
1 2 3 4 5 6 7 8 9 10 | zend_extension=/use/path/../../../here/opcache.so opcache.memory_consumption=256 opcache.interned_strings_buffer=8 opcache.max_accelerated_files=7000 opcache.revalidate_freq=80 opcache.fast_shutdown=1 opcache.enable_cli=1 opcache.enable=1 # debug, it makes faster # opcache.save_comments=0 |
That value of opcache.max_accelerated_files
derived after running :
1 | find . -type f -print | grep php | wc -l |
Those stuffs are written in the article we mentioned at the beginning of this guide. Now, run php5-fpm -t
and service php5-fpm restart
, then service nginx restart
. I have kept a gist with full settings :
1 | https://gist.github.com/AbhishekGhosh/8d0f15080080bcec521d |
Zend OPcache WordPress Visualization Plugin
The basic PHP script :
1 | https://github.com/rlerdorf/opcache-status/blob/master/opcache.php |
is great for testing while installing Nginx PHP5-FPM or initial tuning. It is not great for long run. Whole earth will know many stuffs and PHP alone can be used to enter in the server. This is a great WordPress Plugin :
1 | https://wordpress.org/plugins/opcache/ |
If you see the source code :
1 | https://plugins.svn.wordpress.org/opcache/tags/0.3.1/ |
it will be obvious how much the persons worked behind. It is basically the simple plugin from screenshot but it is modern. It is better because one need to login to WordPress to access it, you need not to add extra security to that file etc. This is their official screenshot :
Tagged With Determines if Zend OPCache is enabled , https://yandex ru/clck/jsredir?from=yandex ru;search;web;;&text=&etext=1821 tLrquKDs_X76DQlVUgPvUjZvhmHqTTFcJa6ACZ9w6ixQhlnED0mrazDYl8n6RFq3 59bef38fa2a5502e7c4a87d0f41d435786881691&uuid=&state=_BLhILn4SxNIvvL0W45KSic66uCIg23qh8iRG98qeIXme , opcache revalidate_freq wordpress , Zend OPcache information plugin , zend opcache wordpress