oracle PHP (WAMP) OCI8 驱动设置问题
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4089469/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
PHP (WAMP) OCI8 driver setup problem
提问by wannabenerd
Greetings,
你好,
I need to install oci8 drivers for PHP, but I'm having some trouble.
我需要为 PHP 安装 oci8 驱动程序,但我遇到了一些麻烦。
I already have a WAMP install, which comes with the oci8 extension, and have done the following in effort to set it up:
我已经安装了 WAMP,它随 oci8 扩展一起提供,并已完成以下工作以进行设置:
- Enabled the extension by adding the following to my php.ini file in my Apache docroot as a local variable:
[PHP_OCI8]
extension=php_oci8.dll - Added my extensions directory path to my PATH environment variable on windows (c:/wamp/bin/php/php5.3.0/ext/;)
- Added the same extensions directory to my php.ini file
- 通过将以下内容作为局部变量添加到我的 Apache docroot 中的 php.ini 文件来启用扩展:
[PHP_OCI8]
extension=php_oci8.dll - 将我的扩展目录路径添加到 Windows 上的 PATH 环境变量中 (c:/wamp/bin/php/php5.3.0/ext/;)
- 将相同的扩展目录添加到我的 php.ini 文件中
When I start up my wamp I see the following error message:
当我启动 wamp 时,我看到以下错误消息:
- PHP Startup: Unable to load dynamic library ‘c:/wamp/bin/php/php5.3.0/ext/php_oci8.dll'
- PHP 启动:无法加载动态库 'c:/wamp/bin/php/php5.3.0/ext/php_oci8.dll'
I'm able to verify that the above path is correct, and am tempted to say that there's something wrong with the .dll, but I'm not sure.
我能够验证上述路径是否正确,并且很想说 .dll 有问题,但我不确定。
Has anyone experienced similar issues?
有没有人遇到过类似的问题?
采纳答案by Powerlord
The Oracle OCI8 driver also requiresthat the Oracle Instant Client10gR2 (aka 10.2.x) libraries or newer be installed on the machine PHP is running on. It is recommended you use either the Basic or Basic Lite version depending on if you need the internationalization libraries or not.
Oracle OCI8 驱动程序还要求在运行 PHP 的机器上安装Oracle Instant Client10gR2(又名 10.2.x)库或更新版本。建议您使用 Basic 或 Basic Lite 版本,具体取决于您是否需要国际化库。
Win32 Instant Client Download Page
Win64 Instant Client Download Page
回答by elwood
An annotation: I recently had the task of installing PHP 5 on a Windows system with Oracle HTTP Server 10g. PHP <= 5.0 requires an Oracle 8i or 9i client, PHP >= 5.1 requires an Oracle 10gR2 client or above. The Oracle HTTP Server 10g deploys an Oracle 10gR1 client which is not at all supported by PHP 5 (at least on Windows, maybe one can compile by himself...), but contains PHP 4.3.9 as an Apache module. I couldn't use it: some PHP modules that are required need at least PHP 5.0. Solution was: return to Oracle HTTP Server from the 9i companion CD while running a 10gR2 database in a separate Oracle Home.
一个注释:我最近有一个任务是在带有 Oracle HTTP Server 10g 的 Windows 系统上安装 PHP 5。PHP <= 5.0 需要 Oracle 8i 或 9i 客户端,PHP >= 5.1 需要 Oracle 10gR2 客户端或更高版本。Oracle HTTP Server 10g 部署了一个 Oracle 10gR1 客户端,PHP 5 根本不支持它(至少在 Windows 上,也许可以自己编译……),但包含 PHP 4.3.9 作为 Apache 模块。我无法使用它:一些需要的 PHP 模块至少需要 PHP 5.0。解决方案是:在单独的 Oracle Home 中运行 10gR2 数据库的同时,从 9i 配套 CD 返回到 Oracle HTTP Server。