How to install ZenOpcache on Centos 6 in 4 steps

How to install ZenOpcache on Centos 6 in 4 steps

 

What is ZenOpcache?

OPcache improves PHP performance by storing pre-compiled script bytecode in the shared memory. This eliminates the stages of reading code from the disk and compiling it on future access. In addition, it applies a few bytecode optimization patterns that make code execution faster. PHP >= 5.5. has Zend OPcache support in core. For PHP from 5.2 to 5.4 you need to install ZenOPcache using PECL

Cài đặt ZenOpcache

1. Install necessary dependencies:

yum install gcc httpd-devel php-pear pcre-devel

2. Install Zen Opcache using PECL

yum install php-pecl-zendopcache

3. Restart Apache

service httpd restart

4. Check if Zend OPcache is loaded successfully

php -v

PHP with Zend OPcache