- 时间:2020-10-24 07:35 编辑: 来源: 阅读:
- 扫一扫,手机访问
摘要:PHP+IIS7配置OCI8链接Oracle 10G的方法
1. 下载适用于Oracle10G的 [url=http://www.oracle.com/technetwork/topics/winsoft-085727.html]Instant Client Package 32Bit,instantclient-basic-win32-10.2.0.5.zip[/url],(如果你是64Bit系统,[url=http://www.oracle.com/technetwork/topics/winx64soft-089540.html]下载[/url]),解压。
2.如果不修改系统PATH,那么解压出来的9个文件,全部放到php的bin目录下,也就是含有php二进制文件的那个目录下,如果有洁癖,那就改个PATH。
3.在IIS的FASTCGI下面选择环境变量编辑 添加如下三个变量
[url=http://php.net/manual/en/function.oci-connect.php]oci_connect()[/url].
| 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 [url=http://php.net/manual/en/function.oci-connect.php]oci_connect()[/url] 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的时候,如果使用完整的TNS语法或者简略的写法,比如8.8.8.8/abc的时候,TNS_ADMIN也不是必须的。具体的还是看官方文档吧,不多说了。