Guidance OCI8 installation/configuration for PHP

Installation and support for Oracle DB on CentOS.
Post Reply
amtradm
Posts: 3
Joined: 2010/10/24 21:29:44

Guidance OCI8 installation/configuration for PHP

Post by amtradm » 2010/10/24 22:05:37

I’m trying to attach oracle to PHP on CentOS5.5. So far I’ve been unable to do so.
The OCI8 module is not configured with PHP5.1 by default, and I haven’t found any YUM modules that install it. If there are no YUM install modules planned, is there a workaround. Any advice helps.

Thanks for Reading.

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: Guidance OCI8 installation/configuration for PHP

Post by pschaff » 2010/10/25 16:23:48

The [url=http://wiki.centos.org/AdditionalResources/Repositories?highlight=%28Remi%29]Remi Collet Repository[/url] seems to have what you are looking for. To use it I suspect you will have to install PHP with all the dependencies from that repo, replacing core packages. Please be sure you understand the implications of that before proceeding. Relevant links:
[url=http://wiki.centos.org/PackageManagement/Yum]PackageManagement/Yum[/url]
[url=http://www.centos.org/modules/newbb/viewtopic.php?topic_id=14408&forum=47]Installing Software[/url]
[url=http://wiki.centos.org/FAQ/General#head-472ce8446ebcfc82ca1800f775ba0e629ac835c7]FAQ#20. Where can I get the latest version of XyZ.rpm for CentOS? I cannot find it anywhere.[/url]

christinaray
Posts: 1
Joined: 2011/01/20 05:04:42
Contact:

Re: Guidance OCI8 installation/configuration for PHP

Post by christinaray » 2011/01/20 05:34:12

Hi,
Download the Basic and the SDK packages from http://www.oracle.com/technology/tec...antclient.html. At the time of this writing, the filenames are instantclient-basic-linux32-10.2.0.1-20050713.zip and instantclient-sdk-linux32-10.2.0.1-20050713.zip.

Unzip these files in a new directory, e.g. /opt/oracle/instantclient.

Try out this and let me know what happen

yyagol
Posts: 1015
Joined: 2006/06/10 18:27:44
Location: 32 4′N 34 47′E
Contact:

Guidance OCI8 installation/configuration for PHP

Post by yyagol » 2011/01/26 06:56:53

have you try following php manual here :
http://www.php.net/manual/en/oci8.installation.php
I use PECL my self and it works fine including TNS connection

szsahin
Posts: 1
Joined: 2011/03/30 15:17:12

Re: Guidance OCI8 installation/configuration for PHP

Post by szsahin » 2011/03/30 15:35:15

I prefer to use 11.1.0.7 zip versions, rpm versions are somewhat problematic at least for me...

- instantclient-basic-linux32-11.1.0.7.zip
- instantclient-sdk-linux32-11.1.0.7.zip

Download them to a folder, e.g. /opt/deploy/oracle/

then,

# cd /opt
# unzip /opt/deploy/oracle/instantclient-basic-linux32-11.1.0.7.zip
# unzip /opt/deploy/oracle/instantclient-sdk-linux32-11.1.0.7.zip

make a few required changes,

# cd /opt/instantclient_11_1
# ln -s libclntsh.so.11.1 libclntsh.so
# ln -s libocci.so.11.1 libocci.so


# cd /opt/deploy/oracle/

As of my writing, curent version is oci8-1.4.5.tgz

# cd /opt/deploy/oracle/
# pecl download oci8
# tar zxvf oci8-1.4.5.tgz
# cd oci8-1.4.5
# phpize
# ./configure --with-oci8=shared,instantclient,/opt/instantclient_11_1
# make
# make install

By making this, oci8 module will be copied to "/usr/lib/php/modules". To enable it,

# echo "extension=oci8.so" > /etc/php.d/oci8.ini

then restart httpd. Then you should see it enabled with "phpinfo()"

Post Reply