简体   繁体   English

Oracle DB 的 PHP OCI8 不适用于 ZAEAZ63489CEE3AA9B36 上的 IIS (OCI_CRED_EXT)

[英]PHP OCI8 for Oracle DB does not work with IIS (OCI_CRED_EXT) on Windows

Running PHP IIS server.运行 PHP IIS 服务器。

error Use of undefined constant OCI_CRED_EXT - assumed 'OCI_CRED_EXT' (this will throw an Error in a future version of PHP)错误使用未定义的常量 OCI_CRED_EXT - 假定为“OCI_CRED_EXT”(这将在 PHP 的未来版本中引发错误)

By running php artiasan serve the connection to the Oracle database is working.通过运行 php artiasan 服务到 Oracle 数据库的连接正在工作。

configuration:配置:

Windows 10 x64 Pro versioan 20H2 Windows 10 x64 专业版 20H2

Manually installed 7.3 Non Thread Safe x86 add path to env手动安装 7.3 非线程安全 x86 添加路径到 env

IIS Server version 10 IIS 服务器版本 10

Laravel 8 Laravel 8

OCI 8.2.2 for WIndows Non Thread Safe (NTS) x86 unpack C:\Program Files (x86)\Php(X86)\7.3 OCI 8.2.2 for WIndows 非线程安全 (NTS) x86 解压 C:\Program Files\786)\Php(X86)

composer install laravel-oci8作曲家安装 laravel-oci8

instantclient-basic-nt-11.2.0.4.0 add path to env Instantclient-basic-nt-11.2.0.4.0 添加路径到 env

add php.ini extensions:php_oci8.dll添加 php.ini 扩展:php_oci8.dll

command cmd命令 cmd

php --ri oci8 php --ri oci8

oci8 oci8

OCI8 Support => enabled OCI8 支持 => 启用

OCI8 DTrace Support => disabled OCI8 DTrace 支持 => 禁用

OCI8 Version => 2.2.0 OCI8 版本 => 2.2.0

Oracle Run-time Client Library Version => 11.2.0.4.0 Oracle 运行时客户端库版本 => 11.2.0.4.0

Oracle Compile-time Instant Client Version => 10.2 Oracle 编译时即时客户端版本 => 10.2

Directive => Local Value => Master Value指令 => 本地值 => 主值

oci8.max_persistent => -1 => -1 oci8.max_persistent => -1 => -1

oci8.persistent_timeout => -1 => -1 oci8.persistent_timeout => -1 => -1

oci8.ping_interval => 60 => 60 oci8.ping_interval => 60 => 60

oci8.privileged_connect => Off => Off oci8.privileged_connect => 关闭 => 关闭

oci8.statement_cache_size => 20 => 20 oci8.statement_cache_size => 20 => 20

oci8.default_prefetch => 100 => 100 oci8.default_prefetch => 100 => 100

oci8.old_oci_close_semantics => Off => Off oci8.old_oci_close_semantics => 关闭 => 关闭

oci8.events => Off => Off oci8.events => 关闭 => 关闭

Statistics =>统计 =>

Active Persistent Connections => 0活动持久连接 => 0

Active Connections => 0活动连接 => 0

phpinfo does not display oci8 module. phpinfo不显示 oci8 模块。

error_log PHP Warning: PHP Startup: Unable to load dynamic library 'php_oci8.dll' (tried: C:\Program Files (x86)\Php(X86)\7.3\ext\php_oci8.dll (The specified module could not be found.), C:\Program Files (x86)\Php(X86)\7.3\ext\php_php_oci8.dll.dll (The specified module could not be found.)) in Unknown on line 0 error_log PHP Warning: PHP Startup: Unable to load dynamic library 'php_oci8.dll' (tried: C:\Program Files (x86)\Php(X86)\7.3\ext\php_oci8.dll (The specified module could not be found. ), C:\Program Files (x86)\Php(X86)\7.3\ext\php_php_oci8.dll.Z06416233FE5EC4C5933122E4AB2488 行中的未知(无法在 AF1 行中指定模块)

php_oci8.dll the library exists in the specified path. php_oci8.dll库存在于指定路径。

tried to check the instant client oracle, sqlplus connects to the database.尝试检查即时客户端oracle,sqlplus连接到数据库。

read a lot of information, but I'm stumped how to move forward.阅读了很多信息,但我很难过如何前进。

You configuration isn't picking up Instant Client.您的配置没有选择 Instant Client。 Where is it installed and have you set PATH?它安装在哪里,您是否设置了 PATH? Maybe you need to move libraries to where the php dlls are?也许您需要将库移动到 php dll 所在的位置?

Some really old notes I have are at https://blogs.oracle.com/opal/how-to-use-iis,-php-and-oracle我在https://blogs.oracle.com/opal/how-to-use-iis,-php-and-oracle有一些非常古老的笔记

Also, for historic reasons OCI_CRED_EXT isn't supported on Windows, see https://github.com/php/php-src/blob/php-8.0.3/ext/oci8/oci8.c#L941-L948此外,由于历史原因,Windows 不支持 OCI_CRED_EXT,请参阅https://github.com/php/php-src/blob/php-8.0.3/ext/oci8/oci8.c#L941-L948

What do you need OCI_CRED_EXT for?你需要 OCI_CRED_EXT 做什么?

(And why are you using such old Oracle Client libraries, - you should be able to drop in a newer set, since they keep compatibility) (你为什么要使用这么旧的 Oracle 客户端库, - 你应该能够放入更新的集合,因为它们保持兼容性)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM