If you want to install OPcache on a DirectAdmin server you can use the instructions below. First, check whether it is already installed, to avoid losing the previous customizations you have applied. Run the following command to check (## represents the PHP version) for each installed PHP version:

/usr/local/php##/bin/php -m  | grep -i opcache

 

Install OPcache via CLI

To install OPcache on a DirectAdmin server, use CustomBuild to complete the installation by running the following commands from the SSH console as root user:

cd /usr/local/directadmin/custombuild
./build set opcache yes
./build opcache

Confirm the installation as follows. Replace ## with PHP version.

/usr/local/php##/bin/php -m  | grep -i opcache

To check PHP versions 5.6 and 7.3, run the following command:

/usr/local/php56/bin/php -m  | grep -i opcache
/usr/local/php73/bin/php -m  | grep -i opcache

Alternatively, to verify all installed PHP versions simultaneously run the following command:

for each in $(ls -lah /usr/local/ | grep -Po 'php[\d][\d]'); do printf "$each :\n";  /usr/local/$each/bin/php -m  | grep -i opcache ;done

 

Install OPcache via CustomBuild GUI Plugin

You can use the CustomBuild plugin to install OPcache. For this:

  • Log in to DirectAdmin as admin
  • Access the CustomBuild Plugin
  • Click on the "Build Software" tab
  • Locate "Build opcache" in the list; click on the "Build" button
  • A window showing the progress of the installation will be displayed

 

If you encounter any problems in applying the above instructions please contact us. HostX offers the fastest KVM VPS servers and can offer you specialized assistance in DirectAdmin administration.

Was this answer helpful? 0 Users Found This Useful (0 Votes)