admin 管理员组文章数量: 887007
配置环境:
- windows7
- PHP Version 5.6.19
- Oracle Database 11g Enterprise Edition Release 11.2.0.1.0
安装oci扩展
(PHP官方说明)
Configuring PHP with OCI8
Review the previous Requirements section before configuring OCI8.
To enable the OCI8 extension, configure PHP with the option –with-oci8 .
翻译:打开–with-oci8配置即可开启OCI8扩展Before starting the web server, OCI8 typically requires several Oracle environment variables (see below) to locate libraries, point to configuration files, and set some basic properties such as the character set used by Oracle libraries. The variables should be set before any PHP process starts.
PHP should be run with the same, or more recent, major version of Oracle libraries as it was configured with. For example, if you build OCI8 with Oracle 11.2 libraries, then PHP should also be deployed and run with Oracle 11.2 libraries.
翻译:PHP需要配置与连接的oracle数据库相同版本或者更新版本的OCI扩展库。……
Installing OCI8 on Windows
On Windows, uncomment the php.ini line extension=php_oci8.dll when using Oracle 10gR2 client libraries. Uncomment extension=php_oci8_11g.dll when using Oracle 11g client libraries. These two DLLs contain equivalent functionality and only one may be enabled at a time. Make sure extension_dir is set to the directory containing the PHP extension DLLs.
If using Instant Client, set the system PATH environment variable to the Oracle library directory.
翻译:如果使用Instant Client,设置环境变量指向oralce目录
根据PHP手册得到配置步骤:
- 配置php.ini,打开extension=php_oci8_12c.dll,如果PHP版本非文章中的版本,应该是php_oci8.dll或者php_oci8_11g.dll,这里要根据你使用的oralce版本来选择。dll文件版本高的兼容版本低的,版本低的无法兼容版本高的。
- 安装oralce Instant Client,下载连接。自己选择环境版本,不要搞错操作系统位数就行。
- 将自己下载的Instant Client,放到自己的软件目录里。然后在环境变量的PATH里面加入Instant Client的路径。重启电脑使环境变量生效。(不重启也可,自行baidu)
- 测试连接oracle是否成功。
安装pdo_oci扩展
如果你已经安装OK了oci扩展,那么仅需要将extension=php_pdo_oci.dll打开即可。如果没有则执行安装oci扩展里面2和3步骤。别忘了重启WEB服务器。
版权声明:本文标题:windows下PHP的oci和pdo_oci扩展安装 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.freenas.com.cn/jishu/1732784004h1554938.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论