title: PHP8 + Oracle OCI8 => Fatal error: Uncaught Error: Call to undefined function oci_connect()
body: <p>I have to upgrade an old running and functional app that uses PHP 5.3 32bit, Apache2.2 32bit, Oracle client 11.2 32bit running on Windows 64bit (Win10 for dev, and server for prod).</p>
  <p>The new stack is Apache2.4 32bit, PHP8 32bit and the exact same Oracle client 11.2 32bit.</p>
  <p>And when I run the webapp, I've got this error at the first DB connection attempt  :</p>
  <pre><code>Fatal error: Uncaught Error: Call to undefined function oci_connect() in c:\some\path\connexion_check.php:16 Stack trace: #0 {main} thrown in c:\some\path\connexion_check.php on line 16
  </code></pre>
  <p>My installation was done using these packages :</p>
  <ul>
  <li>httpd-2.4.48-win32-VS16.zip</li>
  <li>php-8.0.8-Win32-vs16-x86.zip</li>
  <li>php_oci8-3.0.1-8.0-ts-vs16-x86.zip</li>
  <li>php-debug-pack-8.0.8-Win32-vs16-x86.zip</li>
  </ul>
  <p>In my PHP.ini file, I have set</p>
  <pre><code>extension_dir = &quot;ext&quot;
  extension=oci8_11g 
  </code></pre>
  <p>There, I use the same parameter as with PHP5.3 =&gt; extension=oci8_11g
  but the DLL was updated with the package php_oci8-3.0.1-8.0-ts-vs16-x86.zip</p>
  <p>Running the command <strong>php --ri oci8</strong> says</p>
  <pre><code>oci8
  
  OCI8 Support =&gt; enabled
  OCI8 DTrace Support =&gt; disabled
  OCI8 Version =&gt; 3.0.1
  Oracle Run-time Client Library Version =&gt; 11.2.0.3.0
  Oracle Compile-time Instant Client Version =&gt; 11.2
  
  Directive =&gt; Local Value =&gt; Master Value
  oci8.max_persistent =&gt; -1 =&gt; -1
  oci8.persistent_timeout =&gt; -1 =&gt; -1
  oci8.ping_interval =&gt; 60 =&gt; 60
  oci8.privileged_connect =&gt; Off =&gt; Off
  oci8.statement_cache_size =&gt; 20 =&gt; 20
  oci8.default_prefetch =&gt; 100 =&gt; 100
  oci8.old_oci_close_semantics =&gt; Off =&gt; Off
  oci8.connection_class =&gt; no value =&gt; no value
  oci8.events =&gt; Off =&gt; Off
  
  Statistics =&gt;
  Active Persistent Connections =&gt; 0
  Active Connections =&gt; 0
  </code></pre>
  <p>Some PHPINFO (from CLI)</p>
  <pre><code>phpinfo()
  PHP Version =&gt; 8.0.8
  
  System =&gt; Windows NT D20899 10.0 build 19042 (Windows 10) i586
  Build Date =&gt; Jun 29 2021 15:54:30
  Build System =&gt; Microsoft Windows Server 2019 Datacenter [10.0.17763]
  Compiler =&gt; Visual C++ 2019
  Architecture =&gt; x86
  Configure Command =&gt; cscript /nologo /e:jscript configure.js  &quot;--enable-snapshot-build&quot; &quot;--enable-debug-pack&quot; &quot;--with-pdo-oci=..\..\..\..\instantclient\sdk,shared&quot; &quot;--with-oci8-19=..\..\..\..\instantclient\sdk,shared&quot; &quot;--enable-object-out-dir=../obj/&quot; &quot;--enable-com-dotnet=shared&quot; &quot;--without-analyzer&quot; &quot;--with-pgo&quot;
  Server API =&gt; Command Line Interface
  Virtual Directory Support =&gt; enabled
  Configuration File (php.ini) Path =&gt;
  Loaded Configuration File =&gt; C:\www\php8\php.ini
  Scan this dir for additional .ini files =&gt; (none)
  Additional .ini files parsed =&gt; (none)
  PHP API =&gt; 20200930
  PHP Extension =&gt; 20200930
  Zend Extension =&gt; 420200930
  Zend Extension Build =&gt; API420200930,TS,VS16
  PHP Extension Build =&gt; API20200930,TS,VS16
  Debug Build =&gt; no
  Thread Safety =&gt; enabled
  Thread API =&gt; Windows Threads
  Zend Signal Handling =&gt; disabled
  Zend Memory Manager =&gt; enabled
  Zend Multibyte Support =&gt; disabled
  IPv6 Support =&gt; enabled
  DTrace Support =&gt; disabled
  
  Registered PHP Streams =&gt; php, file, glob, data, http, ftp, zip, compress.zlib, compress.bzip2, https, ftps, phar
  Registered Stream Socket Transports =&gt; tcp, udp, ssl, tls, tlsv1.0, tlsv1.1, tlsv1.2, tlsv1.3
  Registered Stream Filters =&gt; convert.iconv.*, string.rot13, string.toupper, string.tolower, convert.*, consumed, dechunk, zlib.*, bzip2.*
  
  This program makes use of the Zend Scripting Language Engine:
  Zend Engine v4.0.8, Copyright (c) Zend Technologies
      with Xdebug v3.0.4, Copyright (c) 2002-2021, by Derick Rethans
  </code></pre>
  <p>Besides this webapp, I manage/use other apps/tools that connect to my Oracle DB using that same InstantClient installation. DB connections are ok from this computer  using :</p>
  <ul>
  <li>Oracle tools</li>
  <li>Powerbuilder 32bit</li>
  <li>Python 32bit + cx_Oracle</li>
  <li>Microsoft Word through Oracle Data Provider for .NET and OLEDB</li>
  </ul>
  <p>I've checked a lot of things but can't figure out what's wrong.
  Thanks for your help :-)</p>
  <p>Edited :</p>
  <pre><code>C:\www\php8&gt;php -m
  [PHP Modules]
  bcmath
  bz2
  calendar
  Core
  ctype
  curl
  date
  dom
  filter
  hash
  iconv
  json
  libxml
  mysqlnd
  oci8
  openssl
  pcre
  PDO
  Phar
  readline
  Reflection
  session
  SimpleXML
  SPL
  standard
  tokenizer
  xdebug
  xml
  xmlreader
  xmlwriter
  zip
  zlib
  
  [Zend Modules]
  Xdebug
  </code></pre>