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
With Cent OS 6
If you use PHP 5.6
If you use PHP 5.5
Restart PHP-FPM .
Now type php-fpm -v, if it returns as the output
Then it was installed OR you can check the information phpinfo(), it also shows the same result.
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
Or just editing 2 these lines
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.
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
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
Code:
yum --enablerepo=remi,remi-php56 install php-opcache
service php-fpm restart
Code:
yum --enablerepo=remi,remi-php55 install php-opcache
service php-fpm restart
Code:
php-fpm service restart
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
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
Code:
opcache.memory_consumption=128
opcache.max_accelerated_files=4000
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.