Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Connect to Remote Oracle database

Arun PrasathJul 26 2013 — edited Aug 1 2013

Hi all,

I want to connect to remote oracle database in PHP. I've googled a lot but couldn't find any solution.

Can any one guide me with step by step process please???

I tried with this code

$con = oci_connect('username', 'password', '//server ip:port/service name');

but it's throwing "Call to undefined function oci_connect()" error.

Comments

Start by installing (or properly installing) the OCI8 extension.  If you think you already have it installed, check the section "Commonly Seen Connection and Environment Errors" on p 107 of The Underground PHP and Oracle Manual

Arun Prasath

Thanks for the reply CJ.

But I didn't run any separate setup for the OCI8 extension. How to install the OCI8 extension?

There are various installation instructions on the web.  The steps you use depend on your OS and what Oracle libraries you have/want installed. 

Check out PHP: Requirements - Manual and the subsequent installation section.  Or look at chapter 8 in The Underground PHP and Oracle Manual

Arun Prasath

I'm using Windows server 2003 with IIS6. As I didn't run any separate setup for the OCI8 extension. But i'm having TOAD and i'm connecting to that remote database using that. Do i need to install oracle client separately???

I don't know what Oracle libraries the recent versions of TOAD install.  Does TOAD have an oci.dll?  It's been a while since I've seen a TOAD user. [Side note: the SQL Developer 4.0 early adopter release is just out: Oracle SQL Developer Downloads.]

Although having multiple installs of Oracle libraries on Windows can be problematic (another reason to use Linux!), you might just want to install Oracle Instant Client and try PHP with it.  The install is a simple unzip & setting of PATH, so it's easy to back out if there are problems.

Arun Prasath

I've downloaded and unzipped the basiclite of instantclient. Where to set the path of that??

And one more thing, the extension path of PHP installation is not having php_oci8.dll and php_oci8_11g.dll and i couldn't find any directive for those both dlls in php.ini file.. But if i install WAMP, i'm getting both dlls and directives in php.ini file..

I'm totally confused!!!!

Regarding PATH, see "Installing Oracle Instant Client on Windows" at the bottom of p 84 of The Underground PHP and Oracle Manual.

I'd like to help you more, but I you haven't given particularly useful information, nor seemed to have read any existing installation instructions,

nor Googled:

database - PHP (WAMP) OCI8 driver setup problem - Stack Overflow

Installing PHP with OCI8 enabled

1 - 7
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Aug 29 2013
Added on Jul 26 2013
7 comments
5,825 views