How to Install OCI8 for PHP 7 on CentOS 6 or RHEL 6 Linux
This post will guide you how to install OCI8 for PHP 7 on your CentOS/RHEL Linux server. How to install OCI8 with PEAR package manager on CentOS/RHEL 6.10 Linux.
- What is OCI8?
- Installing Oracle Instant Client And SDK
- Installing Additional Packages
- Installing PEAR Package Manager
- Installing OCI8 with PEAR
What is OCI8?
OCI8 is the PHP extension for connecting to Oracle Database. OCI8 is open source and included with PHP. The name is derived from Oracle’s C “call interface” API first introduced in version 8 of Oracle Database. OCI8 links with Oracle client libraries, such as Oracle Instant Client.
Installing Oracle Instant Client And SDK
Before installing OCI8 on your CentOS or RHEL Linux, you need to download and install Oracle Instant client and Oracle Install SDK packages.
To download Oracle Instant client packages, you can go to oracle download page to get it with the following command:
$ wget http://download.oracle.com/otn/linux/instantclient/11204/oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm $ wget http://download.oracle.com/otn/linux/instantclient/11204/oracle-instantclient11.2-sqlplus-11.2.0.4.0-1.x86_64.rpm $ wget http://download.oracle.com/otn/linux/instantclient/11204/oracle-instantclient11.2-devel-11.2.0.4.0-1.x86_64.rpm
Note:
Instant Client Package – Basic: All files required to run OCI, OCCI, and JDBC-OCI applications
Instant Client Package – SQL*Plus: Additional libraries and executable for running SQL*Plus with Instant Client
Instant Client Package – SDK: Additional header files and an example makefile for developing Oracle applications with Instant Client
Then you can install those downloaded packages with the following command:
$ yum install oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm oracle-instantclient11.2-devel-11.2.0.4.0-1.x86_64.rpm oracle-instantclient11.2-sqlplus-11.2.0.4.0-1.x86_64.rpm
Outputs:
[root@devops ~]# yum install oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm oracle-instantclient11.2-devel-11.2.0.4.0-1.x86_64.rpm oracle-instantclient11.2-sqlplus-11.2.0.4.0-1.x86_64.rpm Setting up Install Process Examining oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm: oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64 Marking oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm to be installed Examining oracle-instantclient11.2-devel-11.2.0.4.0-1.x86_64.rpm: oracle-instantclient11.2-devel-11.2.0.4.0-1.x86_64 Marking oracle-instantclient11.2-devel-11.2.0.4.0-1.x86_64.rpm to be installed Examining oracle-instantclient11.2-sqlplus-11.2.0.4.0-1.x86_64.rpm: oracle-instantclient11.2-sqlplus-11.2.0.4.0-1.x86_64 Marking oracle-instantclient11.2-sqlplus-11.2.0.4.0-1.x86_64.rpm to be installed Resolving Dependencies --> Running transaction check ---> Package oracle-instantclient11.2-basic.x86_64 0:11.2.0.4.0-1 will be installed ---> Package oracle-instantclient11.2-devel.x86_64 0:11.2.0.4.0-1 will be installed ---> Package oracle-instantclient11.2-sqlplus.x86_64 0:11.2.0.4.0-1 will be installed --> Finished Dependency Resolution Dependencies Resolved ============================================================================================================================= Package Arch Version Repository Size ============================================================================================================================= Installing: oracle-instantclient11.2-basic x86_64 11.2.0.4.0-1 /oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64 179 M oracle-instantclient11.2-devel x86_64 11.2.0.4.0-1 /oracle-instantclient11.2-devel-11.2.0.4.0-1.x86_64 1.9 M oracle-instantclient11.2-sqlplus x86_64 11.2.0.4.0-1 /oracle-instantclient11.2-sqlplus-11.2.0.4.0-1.x86_64 2.8 M Transaction Summary ============================================================================================================================= Install 3 Package(s) Total size: 184 M Installed size: 184 M Is this ok [y/N]: y Downloading Packages: Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64 1/3 Installing : oracle-instantclient11.2-sqlplus-11.2.0.4.0-1.x86_64 2/3 Installing : oracle-instantclient11.2-devel-11.2.0.4.0-1.x86_64 3/3 Verifying : oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64 1/3 Verifying : oracle-instantclient11.2-sqlplus-11.2.0.4.0-1.x86_64 2/3 Verifying : oracle-instantclient11.2-devel-11.2.0.4.0-1.x86_64 3/3 Installed: oracle-instantclient11.2-basic.x86_64 0:11.2.0.4.0-1 oracle-instantclient11.2-devel.x86_64 0:11.2.0.4.0-1 oracle-instantclient11.2-sqlplus.x86_64 0:11.2.0.4.0-1 Complete!
Installing Additional Packages
You need to install some additional packages, such as: gcc, systemtap-sdt-devel, openssl-devel. And upgrade autoconf from the default version to 2.69 or high version. Do the following steps:
#1 install gcc, systemtap-sdt-devel and openssl-devel packages with yum install command, type:
$ yum install gcc systemtap-sdt-devel openssl-devel
Outputs:
[root@devops ~]# yum install gcc Loaded plugins: rhnplugin, security, ulninfo This system is receiving updates from ULN. Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package gcc.x86_64 0:4.4.7-23.0.1.el6 will be installed --> Processing Dependency: cpp = 4.4.7-23.0.1.el6 for package: gcc-4.4.7-23.0.1.el6.x86_64 --> Processing Dependency: cloog-ppl >= 0.15 for package: gcc-4.4.7-23.0.1.el6.x86_64 --> Running transaction check ---> Package cloog-ppl.x86_64 0:0.15.7-1.2.el6 will be installed --> Processing Dependency: libppl_c.so.2()(64bit) for package: cloog-ppl-0.15.7-1.2.el6.x86_64 --> Processing Dependency: libppl.so.7()(64bit) for package: cloog-ppl-0.15.7-1.2.el6.x86_64 ---> Package cpp.x86_64 0:4.4.7-23.0.1.el6 will be installed --> Processing Dependency: libmpfr.so.1()(64bit) for package: cpp-4.4.7-23.0.1.el6.x86_64 --> Running transaction check ---> Package mpfr.x86_64 0:2.4.1-6.el6 will be installed ---> Package ppl.x86_64 0:0.10.2-11.el6 will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================================================================================================================================== Package Arch Version Repository Size ================================================================================================================================================================================================== Installing: gcc x86_64 4.4.7-23.0.1.el6 ol6_x86_64_latest 10 M Installing for dependencies: cloog-ppl x86_64 0.15.7-1.2.el6 ol6_x86_64_latest 93 k cpp x86_64 4.4.7-23.0.1.el6 ol6_x86_64_latest 3.7 M mpfr x86_64 2.4.1-6.el6 ol6_x86_64_latest 156 k ppl x86_64 0.10.2-11.el6 ol6_x86_64_latest 1.3 M Transaction Summary ================================================================================================================================================================================================== Install 5 Package(s) Total download size: 15 M Installed size: 33 M Is this ok [y/N]: y Downloading Packages: (1/5): cloog-ppl-0.15.7-1.2.el6.x86_64.rpm | 93 kB 00:00 (2/5): cpp-4.4.7-23.0.1.el6.x86_64.rpm | 3.7 MB 00:04 (3/5): gcc-4.4.7-23.0.1.el6.x86_64.rpm | 10 MB 00:09 (4/5): mpfr-2.4.1-6.el6.x86_64.rpm | 156 kB 00:00 (5/5): ppl-0.10.2-11.el6.x86_64.rpm | 1.3 MB 00:02 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Total 828 kB/s | 15 MB 00:19 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : mpfr-2.4.1-6.el6.x86_64 1/5 Installing : cpp-4.4.7-23.0.1.el6.x86_64 2/5 Installing : ppl-0.10.2-11.el6.x86_64 3/5 Installing : cloog-ppl-0.15.7-1.2.el6.x86_64 4/5 Installing : gcc-4.4.7-23.0.1.el6.x86_64 5/5 Verifying : cpp-4.4.7-23.0.1.el6.x86_64 1/5 Verifying : ppl-0.10.2-11.el6.x86_64 2/5 Verifying : cloog-ppl-0.15.7-1.2.el6.x86_64 3/5 Verifying : gcc-4.4.7-23.0.1.el6.x86_64 4/5 Verifying : mpfr-2.4.1-6.el6.x86_64 5/5 Installed: gcc.x86_64 0:4.4.7-23.0.1.el6 Dependency Installed: cloog-ppl.x86_64 0:0.15.7-1.2.el6 cpp.x86_64 0:4.4.7-23.0.1.el6 mpfr.x86_64 0:2.4.1-6.el6 ppl.x86_64 0:0.10.2-11.el6 Complete! [root@devops ~]# yum install systemtap-sdt-devel Loaded plugins: rhnplugin, security, ulninfo This system is receiving updates from ULN. Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package systemtap-sdt-devel.x86_64 0:2.9-9.0.1.el6 will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================================================================================================================================== Package Arch Version Repository Size ================================================================================================================================================================================================== Installing: systemtap-sdt-devel x86_64 2.9-9.0.1.el6 ol6_x86_64_latest 68 k Transaction Summary ================================================================================================================================================================================================== Install 1 Package(s) Total download size: 68 k Installed size: 159 k Is this ok [y/N]: y Downloading Packages: systemtap-sdt-devel-2.9-9.0.1.el6.x86_64.rpm | 68 kB 00:00 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : systemtap-sdt-devel-2.9-9.0.1.el6.x86_64 1/1 Verifying : systemtap-sdt-devel-2.9-9.0.1.el6.x86_64 1/1 Installed: systemtap-sdt-devel.x86_64 0:2.9-9.0.1.el6 Complete!
#2 installing the latest version of higher version of autoconf package from source code on your CentOS Linux with the following commands:
$ curl -L -O http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz $ tar zxvf autoconf-2.69.tar.gz $ cd autoconf-2.69 $ ./configure $ make && make install $ rm /usr/bin/autoconf $ ln -s /usr/local/bin/autoconf /usr/bin/autoconf $ autoconf --version
Outputs:
[root@devops ~]# curl -L -O http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 1882k 100 1882k 0 0 707k 0 0:00:02 0:00:02 --:--:-- 710k [root@devops ~]# tar zxvf autoconf-2.69.tar.gz [root@devops ~]# cd autoconf-2.69 [root@devops autoconf-2.69]# ./configure checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu configure: autobuild project... GNU Autoconf configure: autobuild revision... 2.69 configure: autobuild hostname... devops configure: autobuild timestamp... 20190321T033005Z checking whether /bin/sh -n is known to work... yes checking for characters that cannot appear in file names... none checking whether directories can have trailing spaces... yes checking for expr... /usr/bin/expr checking for GNU M4 that supports accurate traces... /usr/bin/m4 checking whether /usr/bin/m4 accepts --gnu... yes checking how m4 supports trace files... --debugfile checking for perl... /usr/bin/perl checking whether /usr/bin/perl Fcntl::flock is implemented... yes checking for emacs... no checking for xemacs... no checking for emacs... no checking where .elc files should go... ${datadir}/emacs/site-lisp checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for a sed that does not truncate output... /bin/sed checking whether make is case sensitive... yes configure: creating ./config.status config.status: creating tests/Makefile config.status: creating tests/atlocal config.status: creating man/Makefile config.status: creating lib/emacs/Makefile config.status: creating Makefile config.status: creating doc/Makefile config.status: creating lib/Makefile config.status: creating lib/Autom4te/Makefile config.status: creating lib/autoscan/Makefile config.status: creating lib/m4sugar/Makefile config.status: creating lib/autoconf/Makefile config.status: creating lib/autotest/Makefile config.status: creating bin/Makefile config.status: executing tests/atconfig commands [root@devops autoconf-2.69]# echo $? 0 [root@devops autoconf-2.69]# make && make install make all-recursive make[1]: Entering directory `/root/autoconf-2.69' Making all in bin make[2]: Entering directory `/root/autoconf-2.69/bin' rm -f autom4te autom4te.tmp [root@devops autoconf-2.69]# autoconf --version autoconf (GNU Autoconf) 2.69 Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+/Autoconf: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>, <http://gnu.org/licenses/exceptions.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by David J. MacKenzie and Akim Demaille.
From the above outputs, you would notice that the latest version of autoconf package has been installed on your system.
Installing PEAR Package Manager
Now you can get and install the PEAR package manager with the following commands:
$ wget http://pear.php.net/go-pear.phar $ php go-pear.phar
Outputs:
[root@devops ~]# wget http://pear.php.net/go-pear.phar --2019-03-20 23:06:02-- http://pear.php.net/go-pear.phar Resolving www-proxy.us.oracle.com... 148.87.19.20 Connecting to www-proxy.us.oracle.com|148.87.19.20|:80... connected. Proxy request sent, awaiting response... 301 Moved Permanently Location: https://pear.php.net/go-pear.phar [following] --2019-03-20 23:06:02-- https://pear.php.net/go-pear.phar Connecting to www-proxy.us.oracle.com|148.87.19.20|:80... connected. Proxy request sent, awaiting response... 200 OK Length: 3605257 (3.4M) Saving to: “go-pear.phar” 100%[===================================================================================>] 3,605,257 726K/s in 5.2s 2019-03-20 23:06:09 (677 KB/s) - “go-pear.phar” saved [3605257/3605257] [root@devops ~]# php go-pear.phar Below is a suggested file layout for your new PEAR installation. To change individual locations, type the number in front of the directory. Type 'all' to change all of them or simply press Enter to accept these locations. 1. Installation base ($prefix) : /usr 2. Temporary directory for processing : /tmp/pear/install 3. Temporary directory for downloads : /tmp/pear/install 4. Binaries directory : /usr/bin 5. PHP code directory ($php_dir) : /usr/share/pear 6. Documentation directory : /usr/docs 7. Data directory : /usr/data 8. User-modifiable configuration files directory : /usr/cfg 9. Public Web Files directory : /usr/www 10. System manual pages directory : /usr/man 11. Tests directory : /usr/tests 12. Name of configuration file : /etc/pear.conf 1-12, 'all' or Enter to continue: Beginning install... Configuration written to /etc/pear.conf... Initialized registry... Preparing to install... installing phar:///root/go-pear.phar/PEAR/go-pear-tarballs/Archive_Tar-1.4.5.tar... installing phar:///root/go-pear.phar/PEAR/go-pear-tarballs/Console_Getopt-1.4.1.tar... installing phar:///root/go-pear.phar/PEAR/go-pear-tarballs/PEAR-1.10.9.tar... installing phar:///root/go-pear.phar/PEAR/go-pear-tarballs/Structures_Graph-1.1.1.tar... installing phar:///root/go-pear.phar/PEAR/go-pear-tarballs/XML_Util-1.4.3.tar... install ok: channel://pear.php.net/Archive_Tar-1.4.5 install ok: channel://pear.php.net/Console_Getopt-1.4.1 install ok: channel://pear.php.net/Structures_Graph-1.1.1 install ok: channel://pear.php.net/XML_Util-1.4.3 install ok: channel://pear.php.net/PEAR-1.10.9 PEAR: Optional feature webinstaller available (PEAR's web-based installer) PEAR: Optional feature gtkinstaller available (PEAR's PHP-GTK-based installer) PEAR: Optional feature gtk2installer available (PEAR's PHP-GTK2-based installer) PEAR: To install optional features use "pear install pear/PEAR#featurename" The 'pear' command is now at your service at /usr/bin/pear ** The 'pear' command is not currently in your PATH, so you need to ** use '/usr/bin/pear' until you have added ** '/usr/bin' to your PATH environment variable. Run it without parameters to see the available actions, try 'pear list' to see what packages are installed, or 'pear help' for help. For more information about PEAR, see: http://pear.php.net/faq.php http://pear.php.net/manual/ Thanks for using go-pear!
Checking If PEAR Works
After installed PEAR package, you can check the installed version of PEAR on your system to verify if the PEAR package is installed successfully, type:
$ pear version
Outputs:
[root@devops ~]# pear version PEAR Version: 1.10.9 PHP Version: 7.3.2 Zend Engine Version: 3.3.2
Installing OCI8 with PEAR
Before intalling OCI with PEAR package manager, you need to export one variable PHP_DTRACE on your system with the following command:
$ export PHP_DTRACT=yes
Then you can start to install OCI8 package with the pecl install command, type:
$ pecl install oci8
Outputs:
[root@devops ~]# pecl install oci8-2.2.0
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
downloading oci8-2.2.0.tgz ...
Starting to download oci8-2.2.0.tgz (196,449 bytes)
.........................................done: 196,449 bytes
11 source files, building
running: phpize
Configuring for:
PHP Api Version: 20180731
Zend Module Api No: 20180731
Zend Extension Api No: 320180731
configure.ac:149: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from...
../../lib/autoconf/general.m4:2661: _AC_LINK_IFELSE is expanded from...
../../lib/autoconf/general.m4:2678: AC_LINK_IFELSE is expanded from...
aclocal.m4:4312: _LT_SYS_MODULE_PATH_AIX is expanded from...
aclocal.m4:7451: _LT_LINKER_SHLIBS is expanded from...
aclocal.m4:8526: _LT_LANG_C_CONFIG is expanded from...
aclocal.m4:3428: _LT_SETUP is expanded from...
aclocal.m4:3357: LT_INIT is expanded from...
aclocal.m4:3392: AC_PROG_LIBTOOL is expanded from...
configure.ac:149: the top level
configure.ac:149: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from...
../../lib/autoconf/general.m4:2661: _AC_LINK_IFELSE is expanded from...
../../lib/autoconf/general.m4:2678: AC_LINK_IFELSE is expanded from...
aclocal.m4:7451: _LT_LINKER_SHLIBS is expanded from...
aclocal.m4:8526: _LT_LANG_C_CONFIG is expanded from...
aclocal.m4:3428: _LT_SETUP is expanded from...
aclocal.m4:3357: LT_INIT is expanded from...
aclocal.m4:3392: AC_PROG_LIBTOOL is expanded from...
configure.ac:149: the top level
configure.ac:149: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from...
../../lib/autoconf/general.m4:2661: _AC_LINK_IFELSE is expanded from...
../../lib/autoconf/general.m4:2678: AC_LINK_IFELSE is expanded from...
aclocal.m4:4312: _LT_SYS_MODULE_PATH_AIX is expanded from...
aclocal.m4:7451: _LT_LINKER_SHLIBS is expanded from...
aclocal.m4:8526: _LT_LANG_C_CONFIG is expanded from...
aclocal.m4:3428: _LT_SETUP is expanded from...
aclocal.m4:3357: LT_INIT is expanded from...
aclocal.m4:3392: AC_PROG_LIBTOOL is expanded from...
configure.ac:149: the top level
configure.ac:149: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from...
../../lib/autoconf/general.m4:2661: _AC_LINK_IFELSE is expanded from...
../../lib/autoconf/general.m4:2678: AC_LINK_IFELSE is expanded from...
aclocal.m4:7451: _LT_LINKER_SHLIBS is expanded from...
aclocal.m4:8526: _LT_LANG_C_CONFIG is expanded from...
aclocal.m4:3428: _LT_SETUP is expanded from...
aclocal.m4:3357: LT_INIT is expanded from...
aclocal.m4:3392: AC_PROG_LIBTOOL is expanded from...
configure.ac:149: the top level
Please provide the path to the ORACLE_HOME directory. Use 'instantclient,/path/to/instant/client/lib' if you're compiling with Oracle Instant Client [autodetect] : instantclient,/usr/lib/oracle/11.2/client64/lib
building in /tmp/pear/install/pear-build-root5QR1tG/oci8-2.2.0
running: /tmp/pear/install/oci8/configure --with-php-config=/usr/bin/php-config --with-oci8=instantclient,/usr/lib/oracle/11.2/client64/lib
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib
checking for PHP extension directory... /usr/lib64/php/modules
checking for PHP installed headers prefix... /usr/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... gawk
checking for Oracle Database OCI8 support... yes, shared
checking PHP version... 7.3.2, ok
checking OCI8 DTrace support... yes
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking sys/sdt.h usability... yes
checking sys/sdt.h presence... yes
checking for sys/sdt.h... yes
checking size of long int... 8
checking checking if we're on a 64-bit platform... yes
checking Oracle Instant Client directory... /usr/lib/oracle/11.2/client64/lib
checking Oracle Instant Client SDK header directory... /usr/include/oracle/11.2/client64
checking Oracle Instant Client library version compatibility... 11.1
checking for a sed that does not truncate output... (cached) /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for dlfcn.h... yes
checking for objdir... .libs
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC -DPIC
checking if cc PIC flag -fPIC -DPIC works... yes
checking if cc static flag -static works... no
checking if cc supports -c -o file.o... yes
checking if cc supports -c -o file.o... (cached) yes
checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
configure: creating ./config.status
config.status: creating config.h
config.status: executing libtool commands
running: make
CFLAGS="-g -O2" dtrace -h -C -s /tmp/pear/install/oci8/oci8_dtrace.d -o oci8_dtrace_gen.h.bak && /bin/sed -e 's,PHPOCI_,DTRACE_,g' oci8_dtrace_gen.h.bak > oci8_dtrace_gen.h
----------------------------------------------------------------------
Libraries have been installed in:
/tmp/pear/install/pear-build-root5QR1tG/oci8-2.2.0/modules
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
Build complete.
Don't forget to run 'make test'.
running: make INSTALL_ROOT="/tmp/pear/install/pear-build-root5QR1tG/install-oci8-2.2.0" install
Installing shared extensions: /tmp/pear/install/pear-build-root5QR1tG/install-oci8-2.2.0/usr/lib64/php/modules/
running: find "/tmp/pear/install/pear-build-root5QR1tG/install-oci8-2.2.0" | xargs ls -dils
274592 4 drwxr-xr-x. 3 root root 4096 Mar 21 00:18 /tmp/pear/install/pear-build-root5QR1tG/install-oci8-2.2.0
274628 4 drwxr-xr-x. 3 root root 4096 Mar 21 00:18 /tmp/pear/install/pear-build-root5QR1tG/install-oci8-2.2.0/usr
274629 4 drwxr-xr-x. 3 root root 4096 Mar 21 00:18 /tmp/pear/install/pear-build-root5QR1tG/install-oci8-2.2.0/usr/lib64
274630 4 drwxr-xr-x. 3 root root 4096 Mar 21 00:18 /tmp/pear/install/pear-build-root5QR1tG/install-oci8-2.2.0/usr/lib64/php
274631 4 drwxr-xr-x. 2 root root 4096 Mar 21 00:18 /tmp/pear/install/pear-build-root5QR1tG/install-oci8-2.2.0/usr/lib64/php/modules
274627 704 -rwxr-xr-x. 1 root root 717740 Mar 21 00:18 /tmp/pear/install/pear-build-root5QR1tG/install-oci8-2.2.0/usr/lib64/php/modules/oci8.so
Build process completed successfully
Installing '/usr/lib64/php/modules/oci8.so'
install ok: channel://pecl.php.net/oci8-2.2.0
configuration option "php_ini" is not set to php.ini location
You should add "extension=oci8.so" to php.ini
After installed OCI8 on your system, pecl will automatically load the extension in your php.ini, so you need to add “extension=oci8.so” to /etc/php.ini.
Conclusion
You should know that how to install OCI8 on CentOS 6.10 for PHP 7 from this guide. If you want to see more information about OCI8, you can go the official web site of OCI8 directly.