PHP+IIS7配置OCI8鏈接Oracle 10G的方法
1. 下載適用于Oracle10G的 Instant Client Package 32Bit,instantclient-basic-win32-10.2.0.5.zip,(如果你是64Bit系統(tǒng),下載),解壓。
2.如果不修改系統(tǒng)PATH,那么解壓出來(lái)的9個(gè)文件,全部放到php的bin目錄下,也就是含有php二進(jìn)制文件的那個(gè)目錄下,如果有潔癖,那就改個(gè)PATH。
3.在IIS的FASTCGI下面選擇環(huán)境變量編輯 添加如下三個(gè)變量
NLS_LANG=SIMPLIFIED CHINESE_CHINA.ZHS16GBK
ORACLE_HOME=\path\to\php-bin
TNS_ADMIN=\path\to\the-location-of-tnsnames.ora-file

4.在php.ini里面把php_oci8.dll擴(kuò)展啟用
5.結(jié)束掉老的php-cgi進(jìn)程重新訪問(wèn)就可以了
番外:
PHP官方對(duì)于Oracle的連接時(shí)候的一些變量有說(shuō)明,這里的環(huán)境變量,除了ORACLE_HOME之類的也不是必須的,官方都有對(duì)應(yīng)的寫法,可以看說(shuō)明
| NAME | PURPOSE |
|---|---|
| ORACLE_HOME | Contains the directory of the full Oracle Database software. Do not set this when using Oracle Instant Client as it is unnecessary and may cause installation problems. |
| ORACLE_SID | Contains the name of the database on the local machine to be connected to. There is no need to set this if you using Oracle Instant Client, or always pass the connection parameter tooci_connect(). |
| LD_LIBRARY_PATH | Set this (or its platform equivalent, such as DYLD_LIBRARY_PATH, LIBPATH, or SHLIB_PATH) to the location of the Oracle libraries, for example $ORACLE_HOME/lib or/usr/lib/oracle/11.1/client/lib. This variable is not needed if the libraries are located by a different search mechanism, such as with ldconfig or with LD_PRELOAD. |
| NLS_LANG | This is the primary variable for setting the character set and globalization information used by the Oracle libraries. |
| ORA_SDTZ | Sets the Oracle session timezone. |
| TNS_ADMIN | Contains the directory where the Oracle Net Services configuration files such as tnsnames.ora and sqlnet.ora are kept. Not needed if the oci_connect() connection string uses the Easy Connect naming syntax such as localhost/XE. Not needed if the network configuration files are in one of the default locations such as $ORACLE_HOME/network/admin or /etc. |
Less frequently used Oracle environment variables include TWO_TASK, ORA_TZFILE, and the various Oracle globalization settings like NLS* and the ORA_NLS_* variables.
oci_connect的時(shí)候,如果使用完整的TNS語(yǔ)法或者簡(jiǎn)略的寫法,比如8.8.8.8/abc的時(shí)候,TNS_ADMIN也不是必須的。具體的還是看官方文檔吧,不多說(shuō)了。
- iis6手工創(chuàng)建網(wǎng)站后無(wú)法運(yùn)行php腳本的解決方法
- 在IIS下安裝PHP擴(kuò)展的方法(超簡(jiǎn)單)
- 阿里云Windows 2008一鍵安裝包配置php web環(huán)境圖文安裝教程(IIS+Php+Mysql)
- Windows2003下php5.4安裝配置教程(IIS)
- windows server 2008/2012安裝php iis7 mysql環(huán)境搭建教程
- IIS7配置PHP5.5 對(duì)找不到的文件啟用文件監(jiān)視的解決方法
- win2008 iis7/iis7.5下最簡(jiǎn)單最強(qiáng)安裝多版本PHP支持環(huán)境
- IIS服務(wù)器中部署PHP案例詳解
相關(guān)文章
Centos7啟動(dòng)流程及Systemd中Nginx啟動(dòng)配置
今天小編就為大家分享Centos7啟動(dòng)流程及Systemd中Nginx啟動(dòng)配置,小編覺(jué)得內(nèi)容挺不錯(cuò)的,現(xiàn)在分享給大家,具有很好的參考價(jià)值,需要的朋友一起跟隨小編來(lái)看看吧2018-09-09
Windows2016配置多人遠(yuǎn)程桌面登錄的實(shí)現(xiàn)
很多時(shí)候,公司開發(fā)、測(cè)試運(yùn)維會(huì)登錄同一臺(tái)windows服務(wù)器進(jìn)行查詢、更新、維護(hù)等操作,本文就來(lái)介紹一下Windows2016配置多人遠(yuǎn)程桌面登錄的實(shí)現(xiàn),感興趣的可以了解一下2023-10-10
IIS7.5 http 1.1 新建應(yīng)用程序失敗的解決方法
這篇文章主要介紹了IIS7.5 http 1.1 新建應(yīng)用程序失敗的解決方法,備注下,是ASP的網(wǎng)站,需要的朋友可以參考下2014-06-06
windows server 2008 R2 管理員帳戶克隆方法(圖文)
大家知道,黑客入侵一臺(tái)服務(wù)器,一般都會(huì)先建立一個(gè)帳戶,然后再設(shè)法將該帳戶進(jìn)行提權(quán),而且這個(gè)過(guò)程都是隱藏的,下面我們來(lái)試試如何將GUEST帳戶提權(quán)成管理員(administrators)帳戶2015-10-10
WindowServer2022無(wú)法安裝網(wǎng)卡驅(qū)動(dòng)1219-v的問(wèn)題解決
在安裝電腦網(wǎng)卡驅(qū)動(dòng)的時(shí)候,出現(xiàn)了安裝不上的問(wèn)題,本文主要介紹了WindowServer2022無(wú)法安裝網(wǎng)卡驅(qū)動(dòng)1219-v的問(wèn)題解決,具有一定的參考價(jià)值,感興趣的可以了解一下2024-05-05
Windows2008 AHCI功能開啟方法(提升硬盤加速)
AHCI 全名Advanced Host Controller Interface,是 Intel 所主導(dǎo)的一項(xiàng)技術(shù),可以發(fā)揮SATA 硬盤的潛在加速功能,大約可增加30%的硬碟讀寫速度,所以在主板和硬盤都支持的情況下還是開啟該功能。2009-07-07

