Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Connect php to oracle
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