更新时间:2023-02-22 08:11:52
嗯.在Windows 8上尝试执行此操作似乎会产生与您指定的错误相同的错误.我目前正在调查...
我的错误(我启用了错误的extension_dir
行).如下所述,它可以在Win8中工作.
My mistake (I had enabled the wrong extension_dir
line). It works in Win8 just as documented below.
以下步骤应是使OCI与PHP一起工作所需的全部(我刚刚在新安装的Windows 2008 R2 Standard x64虚拟机上对此进行了验证):
The following steps should be all you need to get OCI working with PHP (I've just verified this on a freshly installed Windows 2008 R2 Standard x64 virtual machine):
php-5.6.7-nts-Win32-VC11-x86.zip
中使用C:\php
).instantclient-basic-nt-12.1.0.2.0.zip
使用C:\instantclient_12_1
).c:\php\php.ini-production
复制到c:\php\php.ini
.extension_dir = "ext"
.extension=php_oci8_12c.dll
.C:\php
from php-5.6.7-nts-Win32-VC11-x86.zip
).C:\instantclient_12_1
from instantclient-basic-nt-12.1.0.2.0.zip
).c:\php\php.ini-production
to c:\php\php.ini
.php.ini
:
extension_dir = "ext"
.extension=php_oci8_12c.dll
.这时在命令提示符下运行php --ri oci8
会显示以下输出:
At this point running php --ri oci8
in a command prompt shows me the following output:
C:\>php --ri oci8
oci8
OCI8 Support => enabled
OCI8 DTrace Support => disabled
OCI8 Version => 2.0.9
Revision => $Id: f5a3ee1083d1ffa6adb5143efda6eafa210b8414 $
Oracle Run-time Client Library Version => 12.1.0.2.0
Oracle Compile-time Instant Client Version => 12.1
Directive => Local Value => Master Value
oci8.max_persistent => -1 => -1
oci8.persistent_timeout => -1 => -1
oci8.ping_interval => 60 => 60
oci8.privileged_connect => Off => Off
oci8.statement_cache_size => 20 => 20
oci8.default_prefetch => 100 => 100
oci8.old_oci_close_semantics => Off => Off
oci8.connection_class => no value => no value
oci8.events => Off => Off
Statistics =>
Active Persistent Connections => 0
Active Connections => 0
并检查oci_connect
功能:
C:\>php -r "var_dump(function_exists('oci_connect'));"
bool(true)