How to install Zend Opcache to Optimize your VPS for Better Performance

Markadler

New member
Joined
Jun 14, 2016
Messages
17
Points
0
If you installed WordPress or you are using custom sites on your VPS, then now you may be very interested in speeding up your websites and save resources for hosting server.

Zend Opcache is a technique and optimal cache of PHP code, it works similar to APC but it is better than APC because the speed of accessing is faster than APC.

Install Opcache on your VPS

To install Opcache, use the following commands

Adding REPO EPEL, REMI

With Cent os 7

Code:
rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-2.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
With Cent OS 6

Code:
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
If you use PHP 5.6

Code:
yum --enablerepo=remi,remi-php56 install php-opcache
service php-fpm restart
If you use PHP 5.5

Code:
yum --enablerepo=remi,remi-php55 install php-opcache
service php-fpm restart
Restart PHP-FPM .
Code:
php-fpm service restart
Now type php-fpm -v, if it returns as the output
Code:
[root@myserver~]# php-fpm -v
PHP 5.6.1 (fpm-fcgi) (built: Oct  3 2014 07:29:26)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2014 Zend Technologies
    with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies
Then it was installed OR you can check the information phpinfo(), it also shows the same result.

intall-opcache.png

The default for Opcache Zend will use 128 MB of RAM and supports up to 4,000 caches PHP files. Zend Opcache caches according to file path, not by URI REQUEST so that you are not afraid of duplicate cache. If you want to change this parameter then adjust in its configuration. Currently it has already operated but to make it work better, open the file /etc/php.d/opcache.ini and editing as following lines

Code:
zend_extension=opcache.so
opcache.enable=1
opcache.enable_cli=1
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
opcache.max_wasted_percentage=5
opcache.use_cwd=1
opcache.validate_timestamps=1
opcache.revalidate_freq=60
opcache.fast_shutdown=1
Or just editing 2 these lines

Code:
opcache.memory_consumption=128
opcache.max_accelerated_files=4000
Restart PHP-FPM again

I've installed Zend Opcache my VPS and its loading speed was improved better. Zend Opcache mechanism will help build the cache of the PHP engine and help web systems run smoothly.
 

2Fast2BCn

New member
Joined
May 27, 2016
Messages
10
Points
0
Adding an additional note, to track the status of Zend Opcache, you can use the Web Viewer opcache-gui by amnuts (or install WordPress plugin [URLnf="https://wordpress.org/plugins/opcache/"]OPcache Dashboard[/URLnf] if using Wordpress for your websites).

Its advantages are responsive interface, functionality and can reset/flush opcache.

Installation

Code:
wget https://raw.github.com/amnuts/opcache-gui/master/index.php -O op.php
Screenshot

web-viewer.png
 

tberty

New member
Joined
Jun 16, 2016
Messages
1
Points
0
Does it possible to use both Memcached and Zend Opcache on a same VPS?
 

Referral contests

Referral link for :

Sponsors

Popular tags

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top