Home » Open Source » Programming Interfaces » connect to oracle9i to php 5.0 on iis on win xp
connect to oracle9i to php 5.0 on iis on win xp [message #117231] Mon, 25 April 2005 20:08 Go to next message
kev2
Messages: 3
Registered: April 2005
Junior Member
hi,
i have oracle9i enterprise edition, iis 5.1, php 5.0 and windows xp pro sp2 installed.
i want to configure them in order to write php application to interact with the oracle db. please help me out with this.

thnks in advance.

regards
kev2
Re: connect to oracle9i to php 5.0 on iis on win xp [message #117232 is a reply to message #117231] Mon, 25 April 2005 20:13 Go to previous messageGo to next message
kev2
Messages: 3
Registered: April 2005
Junior Member
Actually i have already uncomment the php_oci8.dll and php_oracle.dll in the php.ini file but i have no idea about setting environment variables for oracle_home and oracle_sid.
on the overall, i'm don't know how to modify the tnsname.ora or sqlnet.ora files. please provide me the steps for that so that i can connect to the oracle db through my php files.

thanks
regards
kev2
Re: connect to oracle9i to php 5.0 on iis on win xp [message #117379 is a reply to message #117232] Tue, 26 April 2005 16:34 Go to previous messageGo to next message
andrew again
Messages: 2574
Registered: March 2000
Senior Member
oracle home (installation path) would be something like c:\apps\oracle\920
oracle sid would be something like my_db or orcl (default database name)

an example of a tnsnames.ora entry would be something like this. SID is the old syntax, SERVICE_NAME is the newer syntax
ORCL.WORLD =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = myhost)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = ORCL)
    )
  )


These are common sqlnet.ora settings:
NAMES.DEFAULT_DOMAIN = world
NAMES.DIRECTORY_PATH= (TNSNAMES)
Re: connect to oracle9i to php 5.0 on iis on win xp [message #117393 is a reply to message #117379] Tue, 26 April 2005 23:38 Go to previous messageGo to next message
kev2
Messages: 3
Registered: April 2005
Junior Member
hi andrew,
thnks for the reply
actually my tnsname.ora file is as below:

ORACLE9I =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = home-9ozzg3osby)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = Oracle9i)
)
)

INST1_HTTP =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = home-9ozzg3osby)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = SHARED)
(SERVICE_NAME = MODOSE)
(PRESENTATION = http://HRService)
)
)

EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)

Thus, i understand that my service_name is oracle9i
and the instance of that database is also oracle9i
but i don't understand what is the meaning of 'world' in your given example of tnsname.ora. could you please explain this for me?

And also my sqlnet.ora looks like this:

SQLNET.AUTHENTICATION_SERVICES= (NTS)

NAMES.DIRECTORY_PATH= (TNSNAMES, ONAMES, HOSTNAME)

so could tell me what i need to modify in order to connect to the db from my php files?
Re: connect to oracle9i to php 5.0 on iis on win xp [message #117499 is a reply to message #117393] Wed, 27 April 2005 10:29 Go to previous message
andrew again
Messages: 2574
Registered: March 2000
Senior Member
.world is just the domain. It could also have been something like .abc.com or .hr.abc.com. e.g. you could have 2 databases called test, then you could distinguish with different domains like test.hr.abc.com and test.sales.abc.com The domain isn't required in a simple test environment. From DOS or other O/S prompt, you should be able to get a response by typing
DOS> tnsping oracle9i


For SQLNET.AUTHENTICATION_SERVICES, you could loosen the restrictions by trying NONE rather than NTS.

NAMES.DIRECTORY_PATH is the connect string resolving method. oracle9i would first try to be resolved in the tnsnames.ora file, then an Oracle Name Server (not commonly used) and then by the hostname (that's quite a restrictive naming method and is not commonly used)

I wouldn't worry about the extproc or the MODOSE (Oracle Servlet Engine) unless you know you need them - they always seem to get created by the database config assistant dbca.
Previous Topic: Perl DBI and interactive SQL script
Next Topic: Oracle and PHP issue---> urgent help is required
Goto Forum:
  


Current Time: Mon Apr 21 11:06:42 CDT 2014

Total time taken to generate the page: 0.56525 seconds