Instructions for installing and configuring the PHP Zend OPcache on CentOS

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


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


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.




2) opcache-gui by amnuts

Responsive, more features and can reset/flush opcache.


wget op.php


3) ocp.php by ck-on

Nostalgic look, is the best way to analyze the cache.



Leave a Reply

Your email address will not be published.