Forum Stats

  • 3,826,046 Users
  • 2,260,590 Discussions


php 5.6 with oracle 11gR2 configuration

User194259 Member Posts: 1
edited Oct 30, 2017 1:47AM in PHP

Hi All,

I have to configure php 5.6 with Oracle I installed oracle client 12.1 and compiled oci8 but unable to connect to database.

export PATH=/opt/apache/php/bin:$PATH

[[email protected] oci]# cd oci8-2.0.12/

[[email protected] oci8-2.0.12]# phpize

Configuring for:

PHP Api Version:         20131106

Zend Module Api No:      20131226

Zend Extension Api No:   220131226

[[email protected] oci8-2.0.12]# ./configure --with-oci8=instantclient,/usr/lib/oracle/12.1/client64/lib

checking for grep that handles long lines and -e... /usr/bin/grep

checking for egrep... /usr/bin/grep -E

checking for a sed that does not truncate output... /usr/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-unknown-linux-gnu

checking host system type... x86_64-unknown-linux-gnu

checking target system type... x86_64-unknown-linux-gnu

checking for PHP prefix... /opt/apache/php

checking for PHP includes... -I/opt/apache/php/include/php -I/opt/apache/php/include/php/main -I/opt/apache/php/include/php/TSRM -I/opt/apache/php/include/php/Zend -I/opt/apache/php/include/php/ext -I/opt/apache/php/include/php/ext/date/lib

checking for PHP extension directory... /opt/apache/php/lib/php/extensions/no-debug-zts-20131226

checking for PHP installed headers prefix... /opt/apache/php/include/php

checking if debug is enabled... no

checking if zts is enabled... no

checking for re2c... re2c

checking for re2c version... 0.13.5 (ok)

checking for gawk... gawk

checking for Oracle Database OCI8 support... yes, shared

checking PHP version... 5.6.5, ok

checking OCI8 DTrace support... no

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/12.1/client64/lib

checking Oracle Instant Client SDK header directory... /usr/include/oracle/12.1/client64

checking Oracle Instant Client library version compatibility... 12.1

checking for ld used by cc... /usr/bin/ld

checking if the linker (/usr/bin/ld) is GNU ld... yes

checking for /usr/bin/ld option to reload object files... -r

checking for BSD-compatible nm... /usr/bin/nm -B

checking whether ln -s works... yes

checking how to recognize dependent libraries... pass_all

checking dlfcn.h usability... yes

checking dlfcn.h presence... yes

checking for dlfcn.h... yes

checking the maximum length of command line arguments... 1572864

checking command to parse /usr/bin/nm -B output from cc object... ok

checking for objdir... .libs

checking for ar... ar

checking for ranlib... ranlib

checking for strip... strip

checking if cc supports -fno-rtti -fno-exceptions... no

checking for cc option to produce PIC... -fPIC

checking if cc PIC flag -fPIC works... yes

checking if cc static flag -static works... no

checking if cc supports -c -o file.o... 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

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

creating libtool

appending configuration tag "CXX" to libtool

configure: creating ./config.status

config.status: creating config.h

config.status: config.h is unchanged

[[email protected] oci8-2.0.12]# make install

/bin/sh /opt/oci/oci8-2.0.12/libtool --mode=install cp ./ /opt/oci/oci8-2.0.12/modules

cp ./.libs/ /opt/oci/oci8-2.0.12/modules/

cp ./.libs/oci8.lai /opt/oci/oci8-2.0.12/modules/

PATH="$PATH:/sbin" ldconfig -n /opt/oci/oci8-2.0.12/modules


Libraries have been installed in:


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/'

See any operating system documentation about shared libraries for

more information, such as the ld(1) and manual pages.


Installing shared extensions:     /opt/apache/php/lib/php/extensions/no-debug-zts-20131226/

Already modify php.ini with



  • Gaz in Oz
    Gaz in Oz Member Posts: 3,785 Bronze Crown
    edited Oct 25, 2017 1:45AM

    Show the code for the login and show the attempt with error message/s

  • Christopher Jones-Oracle
    Christopher Jones-Oracle Member Posts: 1,648 Employee
    edited Oct 30, 2017 1:47AM

    Don't forget to add /usr/lib/oracle/12.1/client64/lib to the library search path, perhaps by editing /etc/sysconfig/httpd (On RHEL or Oracle Linux) systems.  Alternatively, if Instant Client is the only software on the machine, it can be easier just to use ldconfig:

    sudo sh -c "echo /usr/lib/oracle/12.1/client64/lib > /etc/"sudo ldconfig
This discussion has been closed.