APCu APC or use has long been an opcode cache methods are widely used to optimize operation of the VPS. The APC however were not updated, upgraded regular (the latest stable version 3.1.9 on 2011-05-14) and occasionally still appears some junk errors.
With the arrival of Zend default OPcache comes from PHP version 5.5 and later, I predict this will be the future trend to replace APC opcode cache or otherwise.
In this article, I will guide you how to install the Zend PHP version 5.5.14 OPcache latest. The PHP version 5.3 or 5.4 will be installing another, its not mentioned in this article.
To view the current PHP version you use the command php-v
You can use the parameter–enable-opcache when compile PHP, however this is somewhat difficult to make with the majority of users, so please use the how to install additional extension for PHP. Note to install PHP before you start.
1. Add the repo epel, remi
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
This step can be skipped if you have followed the installation instructions LEMP on CentOS or have installed the HocVPS Script.
2. install the Zend PHP’s Opcache
yum-enablerepo = remi-, remi – php55 install php-opcache
service php-fpm restart
After the installation is complete, you see information phpinfo (), if Zend OPcache appears as below is succeeded.
Zend OPcache
3. Zend PHP’s configuration Opcache
By default, OPcache use 128 MB of memory and cache a maximum of 4,000 files. If you want to change this parameter, then simply edit the/etc/php.d/opcache.ini configuration file
nano/etc/php.d/opcache.ini
The information needed
; The OPcache shared memory storage size.
opcache. memory_consumption = 128
; The maximum number of keys (scripts) in the OPcache hash table.
; Only numbers between 200 and 100000 are allowed.
opcache. max_accelerated_files = 4000
4. Web Viewer
Unlike the APC, Zend OPcache has plenty of web applications viewer to monitor the status using OPcache.
1) Opcache-Status by Rasmus Lerdorf
Pretty simple but less features.
Install
wget https://raw.github.com/rlerdorf/opcache-status/master/opcache.php
Photos
rlerdorf-opcache-status
2) opcache-gui by amnuts
Responsive, more features and can reset/flush opcache.
Install
wget https://raw.github.com/amnuts/opcache-gui/master/index.php-O op.php
Photos
amnuts-opcache-gui
3) ocp.php by ck-on
Nostalgic look, is the best way to analyze the cache.
Install
wget https://gist.github.com/ck-on/4959032/raw/0b871b345fd6cfcd6d2be030c1f33d1ad6a475cb/ocp.php
Leave a Reply