How to install ZendOpcache on CentOS?

The Zend OpCache provides faster PHP execution through opcode caching and optimization. It improves PHP performance by storing precompiled script bytecode in the shared memory. This extension is bind with PHP 5.5 and higher version. But, for PHP Versions 5.2, 5.3 and 5.4 it can be installed manually using PECL installer.
Fist check the release version of your server -
cat /etc/redhat-release

Download ZendOpcache and Install -
cd /usr/local/src
wget http://pecl.php.net/get/ZendOpcache
tar xvfz ZendOpcache
 
Go to ZendOpcache directory and run the installer script -
cd zendopcache-7.0.5/
phpize
./configure
make
make install

A successful installation will create "opcache.so" file into the PHP extensions directory. Copy the location path of opcache.so file and put it into php.ini file. Paste below code in php.ini file -

nano /usr/local/lib/php.ini

zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20100525/opcache.so
opcache.enable=1
opcache.enable_cli=1
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
opcache.revalidate_freq=60
opcache.fast_shutdown=1

Save the file and check using php -v. This should show you that Zend OPcache is enabled. Smile 

php -v

PHP 5.4.45 (cli) (built: Oct 1 2015 19:20:34)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
with the ionCube PHP Loader v4.7.5, Copyright (c) 2002-2014, by ionCube Ltd., and
with Zend OPcache v7.0.5, Copyright (c) 1999-2015, by Zend Technologies
with Zend Guard Loader v3.3, Copyright (c) 1998-2013, by Zend Technologies

 
 
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to install latest version of git on CentOS release 6.8 (Final)?

Install latest version of git on CentOS release 6.8 - Step 1. Install Dependencies - yum install...

Daily Useful Linux Commands

Finding the username from provided hosting service name - /script/whoowns domain_name Finding...

How to install MariaDB on CentOS 7?

1. Insatll MariaDB on server -  #yum install mariadb-server OR #yum install -y mariadb...

How to fix Amazon S3-RequestTimeTooSkewed?

If you have configured a Amazon S3 backup server under cPanl backup configuration to upload...

How to install SOAP on CentOS?

Install SOAP on CentOS 1) Fire below command - yum install php-soap Output will be as follow...

Powered by WHMCompleteSolution