Installing the 10g real-time Oracle client and PHP

Source: Internet
Author: User

The following article describes how to install the PHP and Oracle 10g real-time Client. We all know that Oracle 10g Instant Client is the easiest way to connect PHP to remote Oracle, only three libraries are required during installation.

The Instant Client library used by PHP to access Oracle's current API is called OCI8. the name of this C interface was first introduced in oracle8 .) PHP Oracle 8 functions can directly call Oracle 8.1.7, 9.x, or 10.x, or use optional abstract classes such as PEAR MDB2 and ADOdb for convenience.

The Instant Client can also use an earlier version of PHP "oracle" extension, but it calls an unsupported Oracle API. We recommend that you do not use this extension for new development in PHP or Oracle.

To use the Instant Client with PHP 4 in Apache, follow these steps. An existing Oracle database is required; Instant Client does not provide an Oracle database. Generally, this database is located on another computer. If the database is located locally, the Oracle component is generally already available, so that the Instant Client is not required.

Software requirements: software notes

Download "Instant Client Package-Basic" from Oracle Instant Client ".

In Linux, you should also download "Instant Client Package-SDK ".

Apache HTTPD Server PHP still recommends Apache 1.3

PHP-PHP hypertext processor version 4.3 or later

Enable PHP OCI8 extension on Windows

The Instant Client binary file is a supplement to PHP's Windows pre-built binary file.

Download PHP binary compressed files instead of the installer version) and Apache. Install them on the Windows System in the PHP manual. OTN's Open-Source Developer Center contains links to useful background materials, such as "installing Oracle, PHP, and Apache on Windows 2000/XP ", it introduces how to install the traditional and complete version of the Oracle 10g Instant Client ).

Check whether PHP is running normally before continuing the operation. Oracle Support is not enabled at this stage.

Download the Instant Client Basic Package for Windows from the Instant Client page of OTN. The size of the compressed file is about 30 MB.

Create a sub-directory, for example, c: \ instantclient10_1) and copy the following library from the compressed file:

Oraociei10.dll

Orannzsbb10.dll

Oci. dll

The total size of these three files is about 80 MB.

If you want to use an earlier version of "oracle" extension in PHP. ini to enable it with "extension = php_oracle.dll", copy ociw32.dll instead of oci. dll.

Edit this environment and add c: \ instantclient10_1 to PATH before other Oracle Directories ).

For example, on Windows 2000, choose Start> Settings> Control Panel> system> advanced> environment variables ", edit the PATH in the system Variable list.

If the tnsnames. ora file is used to define the Oracle Net service name, copy tnsnames. ora to c: \ instantclient10_1 and set the user environment variable TNS_ADMIN to c: \ instantclient10_1. You can also define the default service name in the LOCAL environment variable.

Set the required Oracle global language environment variables, such as NLS_LANG. If this parameter is not set, the default local environment is used. For more details, see the overview of Oracle PHP application globalization.

You do not need to set unnecessary Oracle variables, such as ORACLE_HOME and ORACLE_SID.

Edit php. ini and do not set the OCI8 extension as a comment:

Extension = php_oci8.dll

Set the extension_dir command to the complete PHP extension DLL path. In PHP 4, the DLL is located in the "extensions" subdirectory of the PHP software. In PHP 5, they are located in "ext.

Restart Apache. The above content is the description of installing the PHP and Oracle 10g real-time client, hoping to provide you with some help in this regard.
 

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.