Question
How to enable Oracle OCI8 extensions for Plesk PHP 7
Answer
Warning: The article is applicable for RHEL/CentOS distributions.
-
Install
packages required to build custom PHP 7 modules
devel
# yum install plesk-php70-devel gcc glibc-devel libmemcached-devel zlib-devel make libaio.x86_64
-
Download
oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm
and
from Oracle OTN and upload it on the server.
oracle-instantclient12.1-devel-12.1.0.2.0-1.x86_64.rpm
-
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.rpm
-
Install oci8 package with
pecl
# /opt/plesk/php/7.0/bin/pecl install oci8-2.2.0
-
Enable
module in
oci8
php.ini
# echo “extension=oci8.so” > /opt/plesk/php/7.0/etc/php.d/oci.ini
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-devel
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.0
# echo “extension=oci8.so” > /opt/plesk/php/7.2/etc/php.d/oci.ini
Check that extension is enabled:
# /opt/plesk/php/7.2/bin/php -m | grep oci
oci8
Additional Information
How to add additional PHP module for PHP engines shipped with Plesk on Linux?