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.
Development Environment used by the author:
Windows 98 version 2
php4.04pl1
Apache 1.3.14 windows
Oracle 8.05 client
after successful CGI installation test. Test with the following Code
$ 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 this method. The parameter is taken as the
if ($ Conn! = False)
{< br> echo "OK";
ocilogoff ($ conn);
}< br> else
echo "false ";
?>
about the 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: used network protocol
HOST: used database server host name
Sid: is the database instance number
.
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.
pass in the set connection string name as the connection string.
it is assumed that Oracle 7.x can also be used in this method, because there is no environment and no tests are conducted. If you are interested, try it. (Source: viphot)