It has taken quite a few hours to piece together how to install PDO_OCI for PHP in OpenSUSE. I have compiled a small how-to if anyone else has a need for this. Enjoy
Since this original post, I have done this same setup on a x64 bit system. There are a few tweaks…
Download and install the x86_64 versions of the Oracle instantclient:
oracle-instantclient-basic-10.2.0.3-1.x86_64.rpm
oracle-instantclient-devel-10.2.0.3-1.x86_64.rpm
./configure is going to want to use …/10.2.0.3/client. The 64-bit version of the instantclient uses …/10.2.0.3/client64. Before running ./configure, run these two commands:
Hello, Guys!
I followed your procedure and installed pdo_oci on a 32 bit opensuse 12.1. php -v, php -m all ok. I can see pdo_oci. But when I created a index.php which is phpinfo(), I cannot find oci enabled. All mysql, sqlite and pgsql, odbc are there. Just missing pdo_oci. I do have a pdo_oci.ini in /etc/php5/conf.d/, I do not know why.
Download and install the x86_64 versions of the Oracle instantclient:
oracle-instantclient11.2-basic-11.2.0.3.0-1.x86_64.rpm
oracle-instantclient11.2-devel-11.2.0.3.0-1.x86_64.rpm
./configure is going to want to use …/11.2/client. The 64-bit version of the instantclient uses …/11.2/client64. Before running ./configure, run these two commands:
ln -nsf /usr/lib/oracle/11.2/client64 /usr/lib/oracle/11.2/client
ln -nsf /usr/include/oracle/11.2/client64 /usr/include/oracle/11.2/client64
When you created the symlink to …/client64/lib/libnnz11.so, put the symlink in lib64:
ln -s /usr/lib/oracle/11.2/client64/lib/libnnz11.so /usr/lib64/libnnz11.so
./configure --with-php-config=php-config --with-pdo-oci=instantclient,/usr,11.2
configure: loading site script /usr/share/site/x86_64-unknown-linux-gnu
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 gcc… gcc
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 gcc accepts -g… yes
checking for gcc option to accept ISO C89… none needed
checking for gcc option to accept ISO C99… -std=gnu99
checking for gcc -std=gnu99 option to accept ISO Standard C… (cached) -std=gnu99
checking how to run the C preprocessor… gcc -std=gnu99 -E
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 minix/config.h usability… no
checking minix/config.h presence… no
checking for minix/config.h… no
checking whether it is safe to define EXTENSIONS… yes
checking for icc… no
checking for suncc… no
checking whether gcc -std=gnu99 and cc understand -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… /usr
checking for PHP includes… -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib
checking for PHP extension directory… /usr/lib64/php5/extensions
checking for PHP installed headers prefix… /usr/include/php5
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 Oracle OCI support for PDO… yes, shared
checking Oracle Install-Dir… instantclient,/usr,11.2 :instantclient,/usr,11.2:
checking if that is sane… yes checking for oci.h… configure: error: I’m too dumb to figure out where the include dir is in your instant client install