SDB:Howto build oci8 extension module for php

Jump to: navigation, search

Howto build oci8 extension module for php

openSUSE 11.2 (x86_64)
Linux 2.6.31.5-0.1-desktop #1 SMP PREEMPT 2009-10-26 15:49:03 +0100 x86_64 x86_64 x86_64 GNU/Linux

  1. get the instant client for oracle site: http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/linuxsoft.html

In this case get the 10.2.0.4 Version
[oracle-instantclient-basic-10.2.0.4-1.x86_64.rpm (34,654,975 bytes) (cksum - 2995184583)]
[oracle-instantclient-devel-10.2.0.4-1.x86_64.rpm (289,838 bytes) (cksum - 2347152071)]

  1. Install package

> rpm -iv oracle-instantclient-basic-10.2.0.4-1.i386.rpm
> rpm -iv oracle-instantclient-devel-10.2.0.4-1.i386.rpm

  1. list the install files

> rpm -ql oracle-instantclient-basic-10.2.0.4-1.x86_64
/usr/lib/oracle/10.2.0.4/client64/bin/genezi
/usr/lib/oracle/10.2.0.4/client64/lib/libclntsh.so.10.1
/usr/lib/oracle/10.2.0.4/client64/lib/libnnz10.so
/usr/lib/oracle/10.2.0.4/client64/lib/libocci.so.10.1
/usr/lib/oracle/10.2.0.4/client64/lib/libociei.so
/usr/lib/oracle/10.2.0.4/client64/lib/libocijdbc10.so
/usr/lib/oracle/10.2.0.4/client64/lib/ojdbc14.jar

  1. install the php5-devel rpm from yast and other devel tools

> yast -i php5-devel gcc make

  1. download the PECL OCI8 package,

> wget http://pecl.php.net/get/oci8-1.4.1.tgz

  1. Extract the package:

> tar -zxvf oci8-1.4.1.tgz
> cd oci8-1.4.1

  1. Prepare the package:

> phpize

  1. Configure the package, either using path Instant Client

> ./configure -with-oci8=shared,instantclient,/usr/lib/oracle/10.2.0.4/client/lib

  1. Install the package:

> make install

  1. Verify installation

"Installing shared extensions: /usr/lib64/php5/extensions/"
> ll /usr/lib64/php5/extensions/
-rwxr-xr-x 1 root root 486841 Jul 13 11:56 oci8.so

  1. Make a symbolic link

> ln -s /usr/lib/oracle/10.2.0.4/client64/lib/libnnz10.so /usr/lib64/libnnz10.so

  1. After either an manual install, edit your php.ini file and add the line:

extension=oci8.so

  1. Restart apache server

> /etc/init.d/apache2 restart

  1. check logs files;

> cat /var/log/apache2/error_log | grep 'oci8.so'

  1. And check the phpinfo();

"OCI8 Support enabled "

If don't have any error, the installation is ok

dorancemc[AT]yahoo.com

================================================

http://www.oracle.com/technology/pub/notes/technote_php_instant.html
http://co.php.net/manual/en/oci8.installation.php
http://rpmfind.net/linux/RPM/opensuse/11.2/x86_64/php5-devel-5.3.0-2.4.3.x86_64.html
http://www.alionet.org/index.php?showtopic=20998
http://download.opensuse.org/repositories/server:/php/server_apache_openSUSE_11.0/

================================================