WIN7 64-bit system PHP connection Oracle database, win7oracle_php tutorial

Source: Internet
Author: User
Tags database issues

WIN7 64-bit system PHP connection to Oracle database, win7oracle


Let's talk about the configuration process

First, download Oracle Instantclient

Download Address: http://www.oracle.com/technetwork/topics/winx64soft-089540.html

Download instantclient-basic-windows.x64-11.2.0.4.0

Decompression path: D:\Program Files (x86) \oracle64client\instantclient_11_2

* Note: The client needs the corresponding database version.

Second, configure the system environment variables

After the PATH environment variable, join:;D: \program Files (x86) \oracle64client\instantclient_11_2

Third, configure PHP support OCI extension

Modifying a configuration file php.ini

Open the configuration as follows

Iv. Restart Apache Service test

Use the probe function phpinfo () to see if the extension is on, and if it appears, the extension is turned on

V. Testing the database connection

Writing oracle.php at the site root, I am connecting to the Oralce database in the virtual machine CentOS

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); }? >

Browser address bar Input http://localhost/oracle.php

Show connected Oracle successd! The database connection was successful.


WIN7 64-bit connection to Oracle database issues

I've met and solved it.
The unit's server configuration of CentOS 5.5 X64, My computer is also Win7 x64, installed Oracle 10g x86 client, can be connected to the database by sqlplus@, but the installation of Toad and PL/SQL is not connected. At first I asked if I had to change the operating system to 32 bits.
It was later tested that the reason was simple, because it was installed in the program Files (X86) folder of the C drive. This folder is special, in order to improve 64-bit compatibility, make compatible with 32-bit mode folder, the general 32-bit software is installed in this, and will run at 32 bits, so it will cause toad,pl/sql to be unable to connect.
So the solution is very simple, as long as the pl/sql,toad installed in the D-drive, it can be connected.

Win7 64-bit operating system, plsql How to connect Oracle database?

Solutions for using plsql+developer+ under win7+64 bit +oracle+11g+64

1) Install Oracle 11g 64-bit (this part will not say it)
2) Installing the 32-bit Oracle Client (instantclient-basic-win32-11.2.0.1.0)
Download Instantclient-basic-win32-11.2.0.1.0.zip (must be 32-bit, do not make the wrong version, the Oracle website has downloaded), Unzip it to product under the Oracle installation directory (this machine is named: instantclient_11_2): D:\Oracle\app\dd\product\instantclient_11_2.
Copy a directory under the root directory of the database installation D:\Oracle\app\dd\product\11.2.0\dbhome_1\NETWORK to the Oracle client directory D:\Oracle\app\dd\product\ Instantclient_11_2 (in fact only need Network\admin\tnsnames.ora)
3) Install PL/SQL Developer
Install PL/SQL Developer, set up OCI library and Oracle_home in Perference->connection, for example, native settings:
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 Nls_lang environment variables, it is best to set to the same as the database side, first query the character set information from the database side:
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" and the variable name is set to "Nls_lang" and the variable value is set to "simplified Chinese_china. ZHS16GBK ", click" OK ";
2&GT: New environment variable "tns_admin" with a value of "D:\Oracle\app\dd\product\instantclient_11_2"
Finally click "OK" to exit.

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

http://www.bkjia.com/PHPjc/866669.html www.bkjia.com true http://www.bkjia.com/PHPjc/866669.html techarticle Win7 64-bit system PHP connection to the Oracle database, win7oracle The following configuration process one, download the Oracle instantclient download address: 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.