`
aaron_ch
  • 浏览: 177293 次
  • 性别: Icon_minigender_1
  • 来自: 苏州
社区版块
存档分类
最新评论

PHP instantclient for oracle

    博客分类:
  • PHP
阅读更多

Oracle 10g Instant Client (free download available) is the easiest way for PHP to connect to a remote Oracle database, requiring installation of only three libraries.

The Instant Client libraries used by PHP access Oracle's current API, called OCI8. (This C interface takes its name from being first introduced in Oracle8.) PHP Oracle 8 Functions can call Oracle 8.1.7, 9.x, or 10.x directly, or optional abstraction classes like PEAR MDB2 and ADOdb can be used for convenience.

The older PHP "oracle" extension can also be used with Instant Client but it calls a deprecated Oracle API. New development with this extension is not recommended by the PHP community or by Oracle.

To use Instant Client with PHP 4 or 5 on Apache, follow the steps below. (See this section for details about 5.1.2 and its refactored OCI8 extension.) An existing Oracle database is needed; Instant Client does not include one.

Typically the database will be on another machine. If the database is local then Oracle components will generally already be available and Instant Client is not required.

Software Requirements:

Software Notes
Oracle Instant Client Download the "Instant Client Package - Basic." On Linux, also download the "Instant Client Package - SDK."
Apache HTTPD Server The PHP community still recommends Apache 1.3
PHP - PHP Hypertext Processor Version 4.3 or later

Enabling the PHP OCI8 Extension on Windows

The Instant Client binaries complement PHP's prebuilt binaries for Windows.

  1. Download the PHP binary zip file (not the installer build) and Apache. Install them following Installation on Windows Systems in the PHP Manual. OTN's PHP Developer Center contains links to useful background material such as "Installing Oracle, PHP, and Apache on Windows 2000/XP," which covers installation of a traditional, full Oracle 10g footprint (which is not required with Instant Client).

    Check that PHP is working before continuing. At this stage Oracle support is not enabled.

  2. Download the Instant Client Basic package for Windows from the Instant Client page on OTN. The zip file is about 30MB in size.

  3. Create a subdirectory (e.g., c:\instantclient10_1) and copy these libraries from the zip file:

    • oraociei10.dll
    • orannzsbb10.dll
    • oci.dll

    Collectively these three files are about 80MB in size.

    To use PHP's older "oracle" extension (enabled with "extension=php_oracle.dll" in php.ini), copy ociw32.dll instead of oci.dll.

  4. Edit the environment and add c:\instantclient10_1 to PATH before any other Oracle directories.

    For example, on Windows 2000, follow Start -> Settings -> Control Panel -> System -> Advanced -> Environment Variables and edit PATH in the System variables list.

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

    Set necessary Oracle globalization language environment variables such as NLS_LANG. If nothing is set, a default local environment will be assumed. See An Overview on Globalizing Oracle PHP Applications for more details.

    Unset unnecessary Oracle variables such as ORACLE_HOME and ORACLE_SID.

  5. Edit php.ini and uncomment the OCI8 extension:

    Set the extension_dir directive to the full PHP extension DLL path. In PHP 4 the DLLs are in the "extensions" sub-directory of the PHP software. In PHP 5 they are in "ext".

    extension=php_oci8.dll
    
  6. Restart Apache.

To check the extension is configured, create a simple PHP script phpinfo.php where the web server can read it.

Load the script into a browser using an "http://" URL. The browser page should contain an "oci8" section saying "OCI8 Support enabled".

<?php
  phpinfo();
?>
分享到:
评论

相关推荐

    windows oracle 客户端 instant client 12.2

    在本案例中,我们关注的是针对Windows 64位系统的版本,即"Instant Client for Microsoft Windows (x64)",具体版本号为12.2.0.1.0,压缩包文件名为"instantclient-basic-windows.x64-12.2.0.1.0.zip"。 **Oracle ...

    instantclient_21_3

    "instantclient_21_3" 是Oracle公司提供的一种轻量级客户端工具,它允许开发者和管理员在不安装完整Oracle数据库服务器的情况下,进行数据库连接、查询和其他操作。这个压缩包主要是为了解决用户在使用Navicat等第三...

    php+pdo_oracle instantClient

    在PHP编程中,如果你想要与Oracle数据库进行交互,就离不开"php+pdo_oracle instantClient"这个组合。本文将深入讲解这个主题,包括PHP、PDO(php_data_objects)、Oracle数据库以及Oracle Instant Client的详细知识。...

    instantclient_12_2.rar

    标题中的"instantclient_12_2.rar"表明这是一个关于Oracle Instant Client的版本,具体为12.2版的压缩包文件,通常包含了用于连接Oracle数据库的各种库和必要的组件。 描述中的"instantclient_12_2.rar"再次确认了...

    instantclient 64bit

    在标签中,"oracle"代表这是Oracle公司的产品,"instantclient"是产品名称,"oracle客户端"则指明这是一个用于连接Oracle数据库的客户端工具。 压缩包子文件的文件名称列表包括: 1. "下载说明.txt":通常会包含...

    instantclient-basic-windows.x64-12.1.0.1.0

    navicat连接报错: Cannot load OCI DLL, Instant Client package is ...第2步:解压此安装包,并将解压出的文件合并到:E:\navicat for oracle\instantclient_11_2 第3步:打开Navicat,选择工具→选项→其他→OCI,

    instantclient(X64).zip

    在给定的`instantclient(X64).zip`压缩包中,包含了不同版本的Oracle Instant Client for 64位Windows系统。 1. `instantclient-basic-windows.x64-12.2.0.1.0.zip`: 这个文件是Oracle Instant Client的基础版,...

    oracle_instantce_windows.x64-12.1.0.2.0.zip

    标签中的“instantclient-ba”可能指的是“Instant Client for Basic Applications”,即适用于基础应用的即时客户端,表明这个软件包设计的目标是为了满足大多数常规应用程序对Oracle数据库连接的需求。 压缩包内...

    instantclient_11_2.zip

    在用Navicat去连接Oracle时,提示以下错误: Cannot load OCI DLL, 126: Instant Client package is required for Baic and ...For more information: http://wiki.navicat.com/wiki/index.php/Instant_client_required

    instantclient-basic-win-x86-64-11.1.0.7.0.zip

    数据连接不成功,请检查该数据库是否已启动尝试加载oracle客户端时引发BadImageFormatException.如果在安装32位Oracle客户端组件的情况下以64位模式运行,将出现此问题... 实际上,System.Data.OracleClient所指向的...

    navicat for oracle oic

    总的来说,"Navicat for Oracle OIC"结合Oracle Instant Client 11.2,提供了一种便捷的方式,让用户无需完整安装Oracle数据库即可进行连接和管理工作,特别适合于需要快速调试、查询或者在无Oracle环境的机器上进行...

    oracle-client-11.2-macos

    下载地址:instantclient-basic-macos.x64-11.2.0.4.0.zip 下载地址:instantclient-sqlplus-macos.x64-11.2.0.4.0.zip 下载地址:instantclient-sdk-macos.x64-11.2.0.4.0.zip 1.2。 将软件包解压缩到一个目录中...

    oracle 11g 32位客户端(完整版)

    2. **Oracle Instant Client**:HAInstantClient可能指的是High Availability版本的Oracle Instant Client,它包含了用于高可用性和故障恢复的组件,如Data Guard、RAC (Real Application Clusters) 相关的支持。...

    oracle-call-interface-programmers-guide(19c).pdf

    OCI连接Oracle19c版本数据库 Oracle调用接口(OCI)是针对自定义或打包...OCI也在轻量级Oracle Instant Client中,允许ISV和客户快速安装和部署OCI应用程序和工具。有关更多信息,请参见Oracle Instant Client页面。

    plsql11g_win_64.rar

    标签“oracle plsql instantclient”提到了Oracle Instant Client。Oracle Instant Client是一款轻量级的软件包,包含连接到Oracle数据库所需的基本库和工具,它允许用户在没有完整Oracle客户端安装的情况下执行SQL...

    oracle 11g 客户端

    3. **Instant Client**:在提供的压缩包文件名“instantclient10_1”中,"Instant Client"是一个轻量级的Oracle客户端,它只包含必要的运行库和API,可以快速安装并占用较少的磁盘空间。Instant Client支持ODBC、...

    Oracle9i客户端精简版

    Oracle9i客户端可能包含Oracle Instant Client,这是一个轻量级的客户端组件,用于快速连接到Oracle数据库,而不必安装完整客户端。Instant Client提供基本的数据库访问功能,如TNS连接、数据查询,适合那些对...

    Linux下安装oracle客户端并配置php5.3

    因项目需要在linux下进行php5.3的oracle客户端编译,简要介绍一下步骤及走过的弯路。 1.下载Oracle客户端程序包,其中包含OCI、OCCI和JDBC-OCI等相关文件。 1.1下载文件地址 ...oracle-instantclient11.

    sqlserver,mysql,oracle数据库连接驱动

    Oracle数据库系统的连接驱动主要分为Oracle Call Interface (OCI)、Oracle JDBC、Oracle ODBC Driver以及Oracle Instant Client等。OCI是C语言的接口,直接与Oracle数据库进行通信。JDBC驱动适用于Java应用程序,...

    WAMP环境中扩展oracle函数库(oci)

    同事昨天接到一个任务,要用php处理oracle数据库的内容,但是php打开oracle扩展不是像mysql那样直接用就行,需要下一点东西才能打开 ...例如选择 Instant Client for Microsoft Windows (x64) 因为php扩

Global site tag (gtag.js) - Google Analytics