问题描述
我们正在从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:
- 已安装的IIS服务器角色
- 已安装的PHP
- 已下载的Oracle Instant Client已下载至C:\ instantclient
- 将C:\ instantclient添加到PATH系统变量
- 将php_oci8.dll添加到php.ini并检查PHP实际上是否正在使用此php.ini
- 重新启动的服务器
- Installed IIS Server Role
- Installed PHP
- Downloaded Oracle Instant Client to C:\instantclient
- Added C:\instantclient to PATH System Variable
- Added php_oci8.dll to php.ini and checked that PHP is actually using this php.ini
- 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:
- 从10.1更新InstantClient。 0.5到10.2.0.5(如中所述:开Windows,php_oci8 DLL需要10gR2或更高版本的Oracle客户端库。)
- 添加
msvcr71.dll的副本
到InstantClient文件夹。 - 从。
- 确保
路径
环境变量正确指向t o InstantClient和PHP文件夹。
- 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)无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!