RE: [PHP-WIN] Help on IIS4.0 +Oracle
| From: | Carlos Correa Goncalves | Date: | Mon, 23 Apr 2001 12:21:44 +0000 |
| Subject: | RE: [PHP-WIN] Help on IIS4.0 +Oracle | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-6984@lists.php.net to get a copy of this message | ||
Hi,
Use the OCI functions with the TNS like it is in your
tnsnames.ora file (C:\ORAWIN\NETWORK\ADMIN\TNSNAMES.ORA):
<?php
putenv("ORACLE_SID=databasename");
putenv("ORACLE_HOME=C:\ORAWIN");
$tns = "(DESCRIPTION = (ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST =
oracleserver)(PORT = 1521)))
(CONNECT_DATA = (SID = databasename) ) )";
$Conn=OCIPLogon("user","password",$tns) or die("Can not connect to
Oracle");
?>
It works with all Oracle versions I´ve tried.
Bye
Carlos
> > -----Original Message-----
> > From: Gu Weidong-a1923c [mailto:a1923c@motorola.com]
> > Sent: Monday, April 23, 2001 2:54 AM
> > To: php-windows@lists.php.net
> > Subject: [PHP-WIN] Help on IIS4.0 +Oracle
> >
> >
> > Is it must to have Oracle 8.1.6 client installed with IIS to
> > access Oracle using OCI?
> > I try to connect the database but got " _oci_open_server:
> > ORA-12154: TNS:could not resolve service name" with 8.0.5
> > client installed. ( I can use the same TNS name to connect
> > the DB in SQL*PLUS)
> >
> >
> > Weidong
> >
> > Regards
> >
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
> > For additional commands, e-mail: php-windows-help@lists.php.net
> > To contact the list administrators, e-mail:
> > php-list-admin@lists.php.net
> >
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
> For additional commands, e-mail: php-windows-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net