Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Connect php to oracle

Re: Connect php to oracle

From: Andy Hassall <andy_at_andyh.co.uk>
Date: Thu, 08 Jan 2004 00:55:40 +0000
Message-ID: <3aapvv4kkkl01vsbsuu1d20sndjrlnrufm@4ax.com>


On Wed, 07 Jan 2004 23:55:52 +0100, Tore Skogly <tore.skogly_at_no.spam.invalid> wrote:

>I am running php 4.3.3 on Windows 2000 server/IIS5.
>I have not yet been able to connect PHP to my Oracle 9 database running on
>another server.
>I have installed Oracle Client software on the server. When I try to run
>this php test page:
>======================
><?php
> echo"Connection Test";
> PutEnv("ORACLE_HOME=C:\oracle\ora92");
> PutEnv("TNS_ADMIN=C:\oracle\ora92\network\admin");
> PutEnv("TWO_TASK=C:\oracle\ora92\network\admin\tnsnames.ora");

 Use single quotes.  

 In double quotes, \n turns into newline, \t turns into tab. You don't want this.

 Alternatively use / instead of \, as Windows will accept / as a directory separator.

> $db="
> (DESCRIPTION =
> (ADDRESS_LIST =
> (ADDRESS =
> (PROTOCOL = TCP)
> (Host = <server ip>)

 Presumably this is not the real code.

>Connection Test
>Warning: ocilogon(): _oci_open_server: Error while trying to retrieve text
>for error ORA-12538 in c:\inetpub\wwwroot\oci8test.php on line 17
 

 Indicates ORACLE_HOME not set correctly, because of the \n \t confusion earlier.

-- 
Andy Hassall (andy@andyh.co.uk) icq(5747695) (http://www.andyh.co.uk)
Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)
Received on Wed Jan 07 2004 - 18:55:40 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US