Bobcares

Enable Oracle OCI8 extensions for Plesk PHP 7

by | Feb 27, 2022

Wondering how to enable Oracle OCI8 extensions for Plesk PHP 7? We can help you.

At Bobcares, we offer solutions for every query, big and small, as a part of our Server Management Service.

Let’s take a look at how our Support Team help a customer  deal with this Plesk issue.

How to enable Oracle OCI8 extensions for Plesk PHP 7?

The OCI8 extension can add to an existing PHP installation by using the DLLs from » PECL repository or the libraries in your PHP installation’s ext directory.

The OCI8 extension lets you access Oracle Database.

1. Firstly, install devel packages required to build custom PHP 7 modules

yum install plesk-php70-devel gcc glibc-devel libmemcached-devel zlib-devel make libaio.x86_64Copy Code

2. Then, download

oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpmCopy Code
and
oracle-instantclient12.1-devel-12.1.0.2.0-1.x86_64.rpmCopy Code
from Oracle OTN and upload it on the server.

3. Next, install oracle-instantclient12* packages:

rpm -Uhv oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm oracle-instantclient12.1-devel-12.1.0.2.0-1.x86_64.rpmCopy Code

4. Install oci8 package with pecl

/opt/plesk/php/7.0/bin/pecl install oci8-2.2.0Copy Code

5. Finally, enable oci8 module in php.ini

echo "extension=oci8.so" > /opt/plesk/php/7.0/etc/php.d/oci.iniCopy Code

To install oci8 extension for other PHP engines installed via Plesk Installer, install PHP devel package for corresponding PHP version. For example, for PHP 7.2:

yum install plesk-php72-develCopy Code

Note: That gcc, glibc-devel and other packages already installed on the Step 1

Repeat steps 4,5 from the above, just make sure that path is for the current PHP version:

/opt/plesk/php/7.2/bin/pecl install oci8-2.2.0Copy Code
echo "extension=oci8.so" > /opt/plesk/php/7.2/etc/php.d/oci.iniCopy Code

Check that extension is enabled:

/opt/plesk/php/7.2/bin/php -m | grep ociCopy Code

oci8

[Need a solution to another query? We are just a click away.]

Conclusion

Today, we saw steps followed by our Support Engineers to enable Oracle OCI8 extension.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

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

Speed issues driving customers away?
We’ve got your back!