php 如何为 xampp 安装 oracle 即时客户端

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4323808/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 12:40:10  来源:igfitidea点击:

how to install oracle instant client for xampp

phpocioci8

提问by Tjorriemorrie

I have XAMPP for Windows 1.7.3 installed.

我安装了适用于 Windows 1.7.3 的 XAMPP。

I'm using Zend Framework and need to use the pdo_oci8 extension. I've enabled the extension - but now getting the error that it can't find the oci.dll file.

我正在使用 Zend Framework,需要使用 pdo_oci8 扩展。我已经启用了扩展 - 但现在收到错误,它找不到 oci.dll 文件。

I've downloaded the instantclient_11_2 zip file from oracle. Unzipped it. It contains a bunch of dll files.

我已经从 oracle 下载了 Instantclient_11_2 zip 文件。解开它。它包含一堆dll文件。

How do I install this on windows? Do I need to run a cmd prompt or move it to a specific folder under xampp?

如何在 Windows 上安装它?我是否需要运行 cmd 提示或将其移动到 xampp 下的特定文件夹?

采纳答案by Tjorriemorrie

I unzipped the file into a directory.

我将文件解压缩到一个目录中。

That directory I placed in c:\xampp, e.g. c:\xampp\intanstclient_11_2

我放在 c:\xampp 的那个目录,例如 c:\xampp\intanstclient_11_2

Then I added that to my windows path variable.

然后我将它添加到我的 Windows 路径变量中。

Quite simple really in the end.

最后真的很简单。

回答by Lubenk

Below you will find the instructions on how to configure/install and enable the Oracle Instant Client?for XAMPP v7, v5.5 and v5.6.

您将在下面找到有关如何为 XAMPP v7、v5.5 和 v5.6 配置/安装和启用 Oracle Instant Client 的说明。

  1. Download and install XAMPP
  2. Modify the php.ini in "C:\xampp\php"
    • Uncomment the following line ";extension=php_oci8_12c.dll ?; Use with Oracle Database 12c Instant Client"
    • Restart Apache
  3. Download the 32 bit (PHP is 32 bit so no need to 64) Oracle Instant Client
    • You need both?Instant Client Package - Basic and?Instant Client Package - SDK
    • Unzip both in "C:\php-sdk\oracle\x86\instantclient_12_1" and "c:\php-sdk\oracle\x86\instantclient_12_1\sdk" respectivly
  4. Add the directory "C:\php-sdk\oracle\x86\instantclient_12_1" to the windows path veritable
    • Under system Properties click Environment Variables
    • Edit the Path variable
    • You need to reboot windows
  5. (Optional) If you want to specify the oracle connections in the?tnsnames.ora file:
  1. 下载并安装 XAMPP
  2. 修改“C:\xampp\php”中的php.ini
    • 取消注释以下行“;extension=php_oci8_12c.dll ?; Use with Oracle Database 12c Instant Client”
    • 重启阿帕奇
  3. 下载 32 位(PHP 是 32 位所以不需要 64)Oracle Instant Client
    • 您同时需要?Instant Client Package - Basic 和?Instant Client Package - SDK
    • 分别解压到“C:\php-sdk\oracle\x86\instantclient_12_1”和“c:\php-sdk\oracle\x86\instantclient_12_1\sdk”
  4. 将目录“C:\php-sdk\oracle\x86\instantclient_12_1”添加到windows路径名副其实
    • 在系统属性下单击环境变量
    • 编辑路径变量
    • 您需要重新启动 Windows
  5. (可选)如果要在 ?tnsnames.ora 文件中指定 oracle 连接:

Thats it :)

就是这样 :)

instruction where taken from here: http://www.gi-architects.co.uk/2016/11/how-to-install-oracle-instant-client-v12-for-xampp-v7-v5-5-v5-6-windows/

从这里获取的指令:http: //www.gi-architects.co.uk/2016/11/how-to-install-oracle-instant-client-v12-for-xampp-v7-v5-5-v5- 6窗/

回答by Lokarno

Google gave me this topic when I searched the problem, but I have not found solution here.

搜索问题时谷歌给了我这个话题,但我在这里没有找到解决方案。

But I found here: http://www.oracle.com/technetwork/articles/dsl/technote-php-instant-084410.html

但我在这里找到:http: //www.oracle.com/technetwork/articles/dsl/technote-php-instant-084410.html

My problem was that I downloaded the 64 version of Oracle instant client, and php seems to be working only with the 32-bit.

我的问题是我下载了 64 位版本的 Oracle 即时客户端,而 php 似乎只能在 32 位上运行。