PHP Oracle Client oci8的安装有什么问题 [英] What is wrong with the installation of php oracle client oci8

查看:190
本文介绍了PHP Oracle Client oci8的安装有什么问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试了所有过程来安装PHP Oracle客户端.

I tried all the procedures to install the PHP Oracle client.

1)我安装了客户端版本8和32位.

1) I installed the Client version 8 and 32 bits.

2)我在php.ini中未注释oci

2) I uncommented oci in php.ini

3)重新启动Wamp:

3) Restarted Wamp:

4)不知道是否真的安装了,但是我在php.ini中得到了引用:

4) Not sure if really installed but I got the references in php.ini:

5)但仍然无法连接:

5) But still cannot connect:

感谢您的帮助

编辑

在php日志中发现以下错误: [2018年4月16日14:35:03 UTC] PHP警告:PHP启动:无法加载动态库'c:/wamp/bin/php/php5.5.12/ext/php_oci8.dll'-%1不是有效的Win32应用程序.

Found these errors in php log: [16-Apr-2018 14:35:03 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.5.12/ext/php_oci8.dll' - %1 is not a valid Win32 application.

在第0行的未知"中

[2018年4月16日14:35:03 UTC] PHP警告:PHP启动:无法加载动态库'c:/wamp/bin/php/php5.5.12/ext/php_oci8_11g.dll'-%1不是有效的Win32应用程序.

[16-Apr-2018 14:35:03 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.5.12/ext/php_oci8_11g.dll' - %1 is not a valid Win32 application.

在第0行的未知"中

推荐答案

手册告诉您哪里出了问题:

The manual tells you where you've gone wrong:

1)我安装了客户端版本8和32位.

1) I installed the Client version 8 and 32 bits.

您正在使用不兼容的库. OCI8的第一段要求文档状态(强调我的意思):

You're using incompatible libraries. The first paragraph of the OCI8 requirements documentation states (emphasis mine):

PHP 5.3,PHP 5.4和PHP 5.5包含OCI8 1.4扩展.它也可以从PECL获得.仅PECL提供了更新的OCI8 2.0版本. OCI8 1.4需要Oracle 12c,11g,10g或9iR2客户端库,并将从PHP 4.3.9开始安装. OCI8 2.0需要Oracle 12c,11g或10g客户端库,并将从PHP 5.2开始安装.

The OCI8 1.4 extension is included with PHP 5.3, PHP 5.4 and PHP 5.5. It is also available from PECL. A newer OCI8 2.0 version is available only from PECL. OCI8 1.4 requires Oracle 12c, 11g, 10g or 9iR2 client libraries and will install on PHP 4.3.9 onwards. OCI8 2.0 requires Oracle 12c, 11g or 10g client libraries and will install on PHP 5.2 onwards.

  • 2)我在php.ini中未注释oci

    2) I uncommented oci in php.ini

    您的屏幕快照显示您已启用php_oci8php_oci8_11g.如OCI8 安装文档中所述,您应该仅启用其中一个扩展. (再次强调我的意思):

    Your screenshot shows you've enabled php_oci8 and php_oci8_11g. You should enable only one of the extensions, as stated in the OCI8 installation documentation (again, emphasis mine):

    在Windows上使用Oracle 10gR2客户端库时,取消注释php.ini行扩展名= php_oci8.dll.使用Oracle 11gR2或更高版本的客户端库时,请取消注释extension = php_oci8_11g.dll或extension = php_oci8.dll.对于Oracle 12c库,请使用extension = php_oci8_12c.dll或extension = php_oci8_11g.dll或extension = php_oci8.dll. 一次只能启用这些DLL之一.

  • 4)不知道是否真的安装了,但是我在php.ini中得到了引用:

    4) Not sure if really installed but I got the references in php.ini:

    安装并已启用,但未正确配置.您的屏幕截图显示了PHP是如何编译的以及各种代码作者,而与您当前的配置无关.

    It's installed and enabled, but not configured correctly. Your screenshots show how PHP was compiled and the various code authors, not anything about your current configuration.

    要使扩展程序正常运行,请尝试以下操作:

    To get the extension working try the following:

    1. 卸载并删除客户端版本8"的所有痕迹.
    2. 安装Oracle InstantClient 11g或12c.这通常意味着只需将.zip文件提取到一个文件夹中,例如c:\instantclient_12_1.
    3. 在InstantClient下载页面上,在InstantClient下载链接之后的行上有一个指向所需VC ++运行时的链接.下载并安装.
    4. 更新您的PATH环境变量,以包括提取InstantClient文件的位置,例如c:\instantclient_12_1.
    5. php.ini中启用php_oci8_11g.dll php_oci8_12c.dll.
    1. Uninstall and remove all traces of the 'Client version 8'.
    2. Install Oracle InstantClient 11g or 12c. This typically means simply extracting the .zip file to a folder, e.g. c:\instantclient_12_1.
    3. On the InstantClient download page there is a link to the required VC++ runtime on the line after the InstantClient download link. Download and install it.
    4. Update your PATH environment variable to include the location where you extracted the InstantClient files, e.g. c:\instantclient_12_1.
    5. In php.ini enable either php_oci8_11g.dll or php_oci8_12c.dll.

    可能需要重新启动,以确保PATH更改对系统可见.

    You might need to reboot to ensure the PATH change is visible to the system.

    请注意,WAMP可能包含多个php.ini文件.确保编辑正确的内容.

    Be aware that WAMP might include multiple php.ini files. Make sure to edit the correct one.

    这篇关于PHP Oracle Client oci8的安装有什么问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆