Applicable to:
- Plesk 12.5 for Linux
Question
How to enable Oracle OCI8 extensions for Plesk PHP 7
Answer
Warning: The article is applicable for RHEL/CentOS distributions.
-
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_64
-
Download
oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm
andoracle-instantclient12.1-devel-12.1.0.2.0-1.x86_64.rpm
from Oracle OTN and upload it on the server. -
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
-
Enable
oci8
module inphp.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
# 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?
Comments
3 comments
Hello,
Thanks. It works but how can we enable for PHP 7.1 and 7.2 too?
#/opt/plesk/php/7.2/bin/pecl install oci8
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
downloading oci8-2.1.8.tgz ...
Starting to download oci8-2.1.8.tgz (194,154 bytes)
.........................................done: 194,154 bytes
11 source files, building
running: phpize
Can't find PHP headers in /usr/include/php
The php-devel package is required for use of this command.
ERROR: `phpize' failed
Thanks a lot.
Ok. I try for PHP 5.6:
# yum install plesk-php56-devel gcc glibc-devel libmemcached-devel zlib-devel make libaio.x86_64
But i've have this result:
Error downloading packages:
plesk-php56-devel-5.6.32-centos7.17102712.x86_64: [Errno 256] No more mirrors to try.
@Erwan PHP devel package have to be installed to us pecl tool. The required steps has been added to the article.
Regarding the second error with PHP5.6, verify that PHP5.6 is installed via Plesk installer. Install/re-install it if necessary and try install plesk-php56-devel
Please sign in to leave a comment.