Connection settings between PHP4.0 and Oracle 8 in Windows

Source: Internet
Author: User

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 Second Edition
Php4.04pl1
Apache 1.3.14 windows
Oracle 8.05 Client
PHP is successfully installed in CGI Mode. 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"); this can be used if the oracle client is 8.1.6i.
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: used network PROTOCOL
HOST: HOST Name of the Database Server
SID: ID of the database instance
After doing so, there 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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.