Win764-bit system, PHP connection to Oracle database, win7oracle_PHP tutorial

Source: Internet
Author: User
In the Win764-bit system, PHP connects to the Oracle database, win7oracle. In the Win764-bit system, PHP is connected to the Oracle Database. in the win7oracle system, the configuration process is described below. 1. download oracleinstantclient: www. oracle. comtechnetworktopicswinx64sof. in The Win7 64-bit system, PHP is connected to

The following describes the configuration process.

1. Download oracle instantclient

: Http://www.oracle.com/technetwork/topics/winx64soft-089540.html

Download instantclient-basic-windows.x64-11.2.0.4.0

Decompress path: D: \ Program Files (x86) \ Oracle64Client \ instantclient_11_2

* Note: The client must have the corresponding database version.

2. configure system environment variables

Add:; D: \ Program Files (x86) \ Oracle64Client \ instantclient_11_2 to the PATH environment variable.

3. configure PHP to support OCI extension

Modify the configuration file php. ini

The configuration is as follows:

4. restart the Apache service for testing

Use the probe function phpinfo () to check whether the extension is enabled. if so, the extension is enabled.

V. test database connection

Write oracle. php in the root directory of the site. I am connected to the Oralce database in the CentOS virtual machine.

The code is as follows:

<?php  $conn = ocilogon('test','test','192.168.23.131:1521/dev');  if (!$conn)  {    $Error = oci_error();    print htmlentities($Error['message']);    exit;  }  else  {    echo "Connected Oracle Successd!"."
"; ocilogoff($conn); }?>

Enter http: // localhost/oracle. php in the address bar of the browser.

Show Connected Oracle Successd! The database is successfully connected.


64-bit connection to ORACLE database in WIN7

I have met and solved it.
CENTOS 5.5X64 is configured on the server of the organization. My computer is also win7 x64. The oracle 10g x86 client installed can be connected to the database through sqlplus, however, if toad and pl/SQL are installed, the connection fails. At first, I asked if I had to change the operating system to 32 bits.
After testing, it was found that the reason was very simple because it was installed in the C drive's Program Files (X86) folder. This folder is special. it is used to improve the 64-bit compatibility and build a folder compatible with the 32-bit mode. Generally, the 32-bit software is installed here by default and runs in 32-bit mode, therefore, toad and PL/SQL cannot be connected.
Therefore, the solution is very simple. as long as PL/SQL and TOAD are installed on the D disk, they can be connected.

In win7 64-bit operating system, how does plsql connect to the oracle database?

Solution to PLSQL + Developer + in win7 + 64-bit + Oracle + 11g + 64-bit

1) install Oracle 11g 64-bit (this part will not be mentioned)
2) install a 32-bit Oracle client (instantclient-basic-win32-11.2.0.1.0)
Download instantclient-basic-win32-11.2.0.1.0.zip (it must be a 32-bit version. do not download it on the Oracle official website.) decompress it to the Product in the Oracle installation directory (the local name is instantclient_11_2 ): d: \ Oracle \ app \ dd \ product \ instantclient_11_2.
Copy a directory D: \ Oracle \ app \ dd \ product \ 11.2.0 \ dbhome_1 \ NETWORK under the root directory of the database installation to the Oracle client directory D: \ Oracle \ app \ dd \ product \ instantclient_11_2 (in fact, only NETWORK \ ADMIN \ tnsnames is required. ora)
3) install PL/SQL Developer
Install PL/SQL Developer and set OCI Library and Oracle_Home in perference-> Connection. for example, set the local machine:
Oracle Home: D: \ Oracle \ app \ dd \ product \ instantclient_11_2
OCI Library: D: \ Oracle \ app \ dd \ product \ instantclient_11_2 \ oci. dll
4) set environment variables (modify environment variables)
For the NLS_LANG environment variables, it is best to set them to be consistent with the database. first, query the character set information from the database:
SQL> select userenv ('language') nls_lang from dual;
NLS_LANG
----------------------------------------------------
SIMPLIFIED CHINESE_CHINA.ZHS16GBK
Right-click "My Computer"-"properties"-"advanced"-"environment variables"-"system environment variables ":
1>. click "new", set the variable name to "NLS_LANG", set the variable value to "SIMPLIFIED CHINESE_CHINA.ZHS16GBK", and click "OK ";
2>. create an environment variable "TNS_ADMIN" with the value "D: \ Oracle \ app \ dd \ product \ instantclient_11_2"
Click "OK" to exit.

Start PL/SQL Developer and run it .... Remaining full text>

Http://www.bkjia.com/PHPjc/866669.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/866669.htmlTechArticleWin7 64-bit system PHP connection Oracle database, win7oracle below the configuration process I, Download oracle instantclient: http://www.oracle.com/technetwork/topics/winx64sof...

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.