Install Zend OPcache in DirectAdmin

Last modified: August 1, 2020
You are here:
Estimated reading time: 1 min

Zend OPcache is basically a modern PHP script caching module which helps to accelerate the PHP performance on the server. It gives a faster PHP execution through Opcode caching and optimization. It also improves the performance of PHP by storing the pre-compiled script code in the shared memory of the server.

 

This pre-compiled script codes will terminate reading the code from the disk and executing it on future accessing. Zend OPcache will also apply some code optimization pattern which helps to execute the code faster than the normal.

 

Install Zend OPcache

1) SSH to the server as root user.

2) Enter into the custom build directory. Which is located below.

# cd /usr/local/directadmin/custombuild

3) Set the OPcache to Yes.

# ./build set opcache yes

Now you will get an output as follows.

[root@user custombuild]# ./build set opcache yes

Changed opcache option from no to yes.

4) Run the below command to execute the OPcache module.

# ./build opcache

while executing, you will get an output like as follows.

[root@user custombuild]# ./build opcache

opCache 7.0.5 is now installed for PHP 5.5.

opCache 7.0.5 PHP extension has been installed successfully.

5) We can check that the OPcache is listing correctly in different ways.

Here I’m listing some of the commands to verify the same.

[root@user /]# 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

 

or

 

[root@user /]# php -m | grep -i zend

Zend Opcache

[Zend Modules]

Zend Opcache

 

or

 

[root@user /]# php -v | grep -i zend

Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

with Zend OPcache v7.2.10, Copyright (c) 1998-2015, by Zend Technologies

 

Also, we can check it by creating a phpinfo.php page and check it from a browser.

 

If you need any further help, please do reach our support department.

 

Was this article helpful?
Dislike 0
Views: 10