laravel - PHP OCI8 for Oracle DB does not work with IIS (OCI_CRED_EXT) on Windows

Running PHP IIS server.
error Use of undefined constant OCI_CRED_EXT - assumed 'OCI_CRED_EXT' (this will throw an Error in a future version of PHP)
By running php artiasan serve the connection to the Oracle database is working.
configuration:
Windows 10 x64 Pro versioan 20H2
Manually installed 7.3 Non Thread Safe x86 add path to env
IIS Server version 10
Laravel 8
OCI 8.2.2 for WIndows Non Thread Safe (NTS) x86 unpack C:\Program Files (x86)\Php(X86)\7.3
composer install laravel-oci8
instantclient-basic-nt-11.2.0.4.0 add path to env
add php.ini extensions:php_oci8.dll
command cmd
php --ri oci8
oci8
OCI8 Support => enabled
OCI8 DTrace Support => disabled
OCI8 Version => 2.2.0
Oracle Run-time Client Library Version => 11.2.0.4.0
Oracle Compile-time Instant Client Version => 10.2
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.events => Off => Off
Statistics =>
Active Persistent Connections => 0
Active Connections => 0
phpinfo does not display oci8 module.
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
php_oci8.dll the library exists in the specified path.
tried to check the instant client oracle, sqlplus connects to the database.
read a lot of information, but I'm stumped how to move forward.
Answer
Solution:
You configuration isn't picking up Instant Client. Where is it installed and have you set PATH? Maybe you need to move libraries to where the php dlls are?
Some really old notes I have are at 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
What do you need OCI_CRED_EXT for?
(And why are you using such old Oracle Client libraries! - you should be able to drop in a newer set, since they keep compatibility)
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: regex stop at first match
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.