How to install Zend Opcache in a DirectAdmin server?

Before going to the installation tips, let’s see what is Zend Opcache.

It’s a modern PHP script caching module which accelerates the PHP performance. Zend Opcache provides faster PHP execution through Opcode caching and optimization. It improves the performance of PHP by storing the precompiled script byte-code in the shared memory. This eliminates reading the code from the disk and compiling it on future access. It also applies few byte-code optimization pattern which help to execute the code faster.

Installation steps

Here I’m explaining the installation steps with custombuild 2.0

Enter the custombuild directory

# cd /usr/local/directadmin/custombuild

Setting opcache to yes

# ./build set opcache yes

You’ll get a sample output as follows:

[[email protected] custombuild]# ./build set opcache yes
Changed opcache option from no to yes

Compiling Opcache module

# ./build opcache
[[email protected]]# ./build opcache
opCache 7.0.5 is now installed for PHP 5.5.
opCache 7.0.5 PHP extension has been installed successfully.

Now check if Opcache is correctly listing:

You can check this in different ways. Please see the sample outputs pasted below:

[[email protected] /]# php -v
PHP 5.5.36 (cli) (built: Jun  7 2016 05:59:15)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies
[[email protected] /]# php -m | grep -i zend
Zend OPcache
[Zend Modules]
Zend OPcache

That’s it!!

Heba Habeeb

Working as a Linux Server Admin, Infopark, Cochin, Kerala.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *