Summary of Enabling Oracle OCI8 Extensions for Plesk PHP7
- 2021-12-04 09:46:08
- OfStack
Note: This article applies to RHEL/CentOS releases.
Step 1. Install the devel package required to build the custom PHP 7 module
# yum install plesk-php70-devel gcc glibc-devel libmemcached-devel zlib-devel make libaio.x86_64
Step 2. Download oracle-instantclient12.1-basic-12. 1.0. 2.0-1.x86_64. rpm and oracle-instantclient12.1-devel-12. 1.0. 2.0-1.x86_64. rpm (from Oracle OTN) and upload them to the server. ,
https://www.ofstack.com/database/572638.html
Step 3. Install the oracle-instantclient12* package:
# 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
Step 4. Install the oci8 package with pecl
# /opt/plesk/php/7.0/bin/pecl install oci8
Step 5. Enable the oci8 module in php. ini
# echo "extension=oci8.so" > /opt/plesk/php/7.0/etc/php.d/oci.ini
To install the oci 8 extension for other PHP engines installed through Plesk, install the PHP devel package for the corresponding PHP version.
For example, for PHP 7.2:
# yum install plesk-php72-devel
Repeat steps 4 and 5 above to ensure that the path is of the current PHP version:
# /opt/plesk/php/7.2/bin/pecl install oci8
# echo "extension=oci8.so" > /opt/plesk/php/7.2/etc/php.d/oci.ini
Check whether the extension is enabled:
# /opt/plesk/php/7.2/bin/php -m | grep oci
oci8