PHP,IIS,Oracle(OCI)无法正常工作 [英] PHP, IIS, Oracle (OCI) not working

查看:145
本文介绍了PHP,IIS,Oracle(OCI)无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在从Windows SBS 2011迁移到Windows Server 2012 R2。

We are migrating from a Windows SBS 2011 to Windows Server 2012 R2.

我们有一个内部网站,使用PHP连接到我们的Oracle数据库。

We have an internal website that connects to our Oracle database using PHP.

我正在尝试将其迁移到新服务器,到目前为止我已经:

I am trying to migrate this to the new server and so far I have:


  1. 已安装的IIS服务器角色

  2. 已安装的PHP

  3. 已下载的Oracle Instant Client已下载至C:\ instantclient

  4. 将C:\ instantclient添加到PATH系统变量

  5. 将php_oci8.dll添加到php.ini并检查PHP实际上是否正在使用此php.ini

  6. 重新启动的服务器

  1. Installed IIS Server Role
  2. Installed PHP
  3. Downloaded Oracle Instant Client to C:\instantclient
  4. Added C:\instantclient to PATH System Variable
  5. Added php_oci8.dll to php.ini and checked that PHP is actually using this php.ini
  6. Restarted server

我仍然收到错误消息,例如oci_命令无法被识别等。

I am still getting error messages like oci_ commands not being recognised etc.

我迷路了。我在网上搜索过,说明书与我在记忆中所做的相符。

I'm lost. I've searched online and the instructions match what I have done from memory.

我还没有在网上找到一件我没做过的事情。

I haven't found a single thing online that I haven't done.

推荐答案

您可能需要包含 bin 路径中的文件夹,如下所示:

Depending on the version of InstantClient you have installed you might need to include the bin folder in the path, like so:

C:\instantclient\bin

要检查路径中是否有DLL文件,请输入其中oci * .dll 在命令提示符下。它应该返回一个匹配文件列表。

To check if the DLL files are available in the path enter where oci*.dll in a command prompt. It should return a list of matching files.

另外,请记住,只是因为你的帐户可以看到DLL文件并不意味着IIS / PHP可以。它运行在可能没有访问文件权限的其他帐户下。检查您的IIS错误日志和PHP php_errors.log 文件是否有任何特定错误消息。

Also, remember that just because your account can see the DLL files doesn't mean IIS/PHP can. That runs under a different account that might not have permission to access the files. Check your IIS error log and PHP php_errors.log file for any specific error messages.

编辑

Edit

经过相当冗长的聊天,问题解决了:

After a rather lengthy chat, the problem was resolved by:

  • Updating the InstantClient from 10.1.0.5 to 10.2.0.5 (as mentioned in the module requirements: On Windows, the php_oci8 DLL needs Oracle client libraries from version 10gR2 or greater.)
  • Adding a copy of msvcr71.dll to the InstantClient folder.
  • Downloading and manually configuring PHP from php.net instead of using PHP Manager for IIS.
  • Ensuring the Path environment variable correctly pointed to the InstantClient and PHP folders.

这篇关于PHP,IIS,Oracle(OCI)无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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