RE: [PHP] Can't login remote oracle server? HELP!
| From: | MEGRET Arnaud | Date: | Fri, 28 Jul 2000 14:44:47 +0000 |
| Subject: | RE: [PHP] Can't login remote oracle server? HELP! | ||
| Groups: | php.dev php.general | ||
| Request: | Send a blank email to php-dev+get-26720@lists.php.net to get a copy of this message | ||
Hi,
Sorry to answer so late to this message. But I have a very similar problem.
I have noticed that the third parameter of OCIlogon is not the entry in
tnsnames.ora but the name of the host where the server is.
In your case , you should try
ociplogon("scott","tiger","db.host.com");
you can also try the IP address of your oracle server.
I don't know how it is possible to refer to the tnsname.ora file.
Documentation seems totally wrong!!
Is there someone who know if new version of the OCI interface is coming or
if there is somewhere we can find a real documentation about this
version?????????
Thanks
Arnaud
> -----Message d'origine-----
> De: Rasmus Lerdorf [SMTP:rasmus@php.net]
> Date: mercredi 12 juillet 2000 08:25
> À: lhf
> Cc: php-general@lists.php.net; php-dev@lists.php.net
> Objet: Re: [PHP] Can't login remote oracle server? HELP!
>
> Try ocilogon("scott","tiger","net")
>
> On Wed, 12 Jul 2000, lhf wrote:
>
> > The last message is too slow,send,again
> >
> > Who sucefully link to the remote oracle server using php?
> > I can't run it!
> > Please help me!
> > Thanks in advance
> >
> >
> > --------------------------------------------------------------
> > php 4.0.1pl2
> > oracle 8i
> > web server: NES 3.6
> > os :Solaris 2.6
> >
> > Oracle is resident at another server,its sid is 'webdb' and
> > service name is 'net.db.host.com'
> >
> > I set up oracle 8i client on the web server,and configure the
> > netec which test ok.
> >
> > When I use tnsping and sqlplus,all works well,
> > for example:
> > tnsping net
> > tnsping db
> > tnsping db.host.com
> > sqlpus scott/tiger@net
> >
> > But when I use php4 with oci8 support,all don't work!
> >
> > This is the example code and error message:
> > source code:
> > ----------------------------------------------------
> > <?
> > putenv("ORACLE_SID=webdb");
> > putenv("ORACLE_HOME=/data/oracle/app/8.1.5");
> > putenv("NLS_LANG=american.america.US7ASCII");
> >
> > $conn = OCIpLogon("scott/tiger@net.db.host.com","");
> > if(!$conn)$conn=OCIpLogon("scott/tiger@webdb","");
> > if(!$conn)$conn=OCIpLogon("scott/tiger@net","");
> >
> > if(!$conn)$conn=OCIpLogon("scott@net.db.host.com","tiger");
> > if(!$conn)$conn=OCIpLogon("scott@webdb","tiger");
> > if(!$conn)$conn=OCIpLogon("scott@net","tiger");
> >
> >
> > if(!$conn)$conn=OCIpLogon("scott","tiger","net.db.host.com");
> > if(!$conn)$conn=OCIpLogon("scott","tiger","webdb");
> > if(!$conn)$conn=OCIpLogon("scott","tiger","net");
> >
> > if($conn)
> > echo "sucessful!";
> > else
> > echo "<font color=red>Connect to database failed!";
> >
> > ?>
> > ---------------------------------------------------------------
> > The error message :
> > ----------------------------------------------------------------
> >
> > Warning: _oci_open_server: ORA-12545: Connect failed because target host
> or
> > object does not exist in /data/php/z.php on line 6
> >
> > Warning: _oci_open_server: ORA-12545: Connect failed because target host
> or
> > object does not exist in /data/php/z.php on line 7
> >
> > Warning: _oci_open_server: ORA-12545: Connect failed because target host
> or
> > object does not exist in /data/php/z.php on line 8
> >
> > Warning: _oci_open_server: ORA-12545: Connect failed because target host
> or
> > object does not exist in /data/php/z.php on line 10
> >
> > Warning: _oci_open_server: ORA-12545: Connect failed because target host
> or
> > object does not exist in /data/php/z.php on line 11
> >
> > Warning: _oci_open_server: ORA-12545: Connect failed because target host
> or
> > object does not exist in /data/php/z.php on line 12
> >
> > Warning: _oci_open_server: ORA-12154: TNS:could not resolve service name
> in
> > /data/php/z.php on line 14
> >
> > Warning: _oci_open_server: ORA-12154: TNS:could not resolve service name
> in
> > /data/php/z.php on line 15
> >
> > Warning: _oci_open_server: ORA-12154: TNS:could not resolve service name
> in
> > /data/php/z.php on line 16
> >
> > Connect to database failed!
> > ---------------------------------------------------------------------
> >
> > This is the tnsnames.ora file on web server
> > ---------------------------------------------------------------------
> > # TNSNAMES.ORA Configuration
> > File:/data/oracle/app/8.1.5/network/admin/tnsnames.ora
> > # Generated by Oracle Net8 Assistant
> >
> > NET =
> > (DESCRIPTION =
> > (ADDRESS_LIST =
> > (ADDRESS = (PROTOCOL = TCP)(HOST = db.host.com)(PORT = 1521))
> > )
> > (CONNECT_DATA =
> > (SERVICE_NAME = net.db.host.com)
> > )
> > )
> >
> > --------------------------------------------------------------------
> >
> > This is the listener.ora on the oracle server
> > --------------------------------------------------------------------
> > # LISTENER.ORA Configuration File:/oracle/app/8.1.5/network/admin/liste
> > # Generated by Oracle Net8 Assistant
> >
> > LISTENER =
> > (DESCRIPTION_LIST =
> > (DESCRIPTION =
> > (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
> > (PROTOCOL_STACK =
> > (PRESENTATION = TTC)
> > (SESSION = NS)
> > )
> > )
> > (DESCRIPTION =
> > (ADDRESS = (PROTOCOL = TCP)(HOST = 10.0.0.13)(PORT = 2481))
> > (PROTOCOL_STACK =
> > (PRESENTATION = GIOP)
> > (SESSION = RAW)
> > )
> > )
> > (DESCRIPTION =
> > (ADDRESS = (PROTOCOL = TCP)(HOST = db.host.com)(PORT = 1521))
> > (PROTOCOL_STACK =
> > (PRESENTATION = TTC)
> > (SESSION = NS)
> > )
> > )
> > )
> >
> > SID_LIST_LISTENER =
> > (SID_LIST =
> > (SID_DESC =
> > (SID_NAME = PLSExtProc)
> > (ORACLE_HOME = /oracle/app/8.1.5)
> > (PROGRAM = extproc)
> > )
> > (SID_DESC =
> > (GLOBAL_DBNAME = net.db.host.com)
> > (ORACLE_HOME = /oracle/app/8.1.5)
> > (SID_NAME = webdb)
> > )
> > )
> > ----------------------------------------------------------
> >
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net