It is very easy for PHP to connect to oracle8 in Linux/Unix, but it is not easy in windows. after a long time of exploration, I found a reliable method and did not dare to enjoy it exclusively,
We will announce it to everyone. The Development Environment used by the author: windows 98 php4.04pl1 apache 1.3.14 windows oracle 8.05 client PHP after successful installation in CGI Mode. Test with the following code
<? Php
$ Conn = OCILogon ("cinmsiii", "cinmsiii", "(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.3.202) (PORT = 1521 )) (CONNECT_DATA = (SID = unicom )))");
// $ Conn = OCILogon ("cinmsiii", "cinmsiii", "cinms"); if the oracle client is 8.1.6i, you can use it like this. if ($ conn! = False)
{
Echo "OK ";
OCILogoff ($ conn );
}
Else
Echo "false ";
?> Connection parameters:
Set the connection string to the following:
(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.3.202) (PORT = 1521) (CONNECT_DATA = (SID = unicom) PROTOCOL: for the network protocol HOST used: for the database server HOST name SID: for the database instance number, this is generally no problem. If your oracle 8 client is 8.1.6i Enterprise Edition, you can set these parameters in the connection string and use the net easy config utility of oracle8.
Input the set connection string name as the connection string. It is suggested that oracle 7.x can also be used in this method. Because there is no environment, no tests are performed. If you are interested, try it. (Source: Viphot)