Download the proper Oracle Instant Client
If using 32 bit PHP, you’ll need use the 32 bit Windows Oracle Instant Client:
Instant Client Downloads for Microsoft Windows (32-bit)
"Instant Client Package - Basic Lite"
Use version 11 of the client, not 12, with PHP’s php_oci8_11g.dll.
Unzip the package into a location such as:
Then modify the System’s
PATH Environmental Variable with the end location. As otherwise the Client’s DLL files (i.e., OCI.dll) will not be found (nor loaded) by PHP’s php_oci8_11g.dll extension…
Restart the system for PATH changes to fully propagate.
Install the VC++ 2012 Runtime
Under PHP 5.5, which is a VC11 (VS.NET 2012) build, some of the extensions depend on the full set of Microsoft VC++ 2012 Runtime DLLs.
Download and install the 32 bit VC++ 2012 Runtime Redistributable (vcredist_x86.exe):
Visual C++ Redistributable for Visual Studio 2012 Update 4
PHP 5.5 extension php_oci8_11g.dll, and other extensions such as php_intl.dll, depend on files: msvcr110.dll and msvcp110.dll, which this will place into your
Check Dependencies of php_oci8_11g.dll
Open the command line, change to the PHP’s directory, and check to see if all php_oci8_11g.dll dependencies (DLL files) are being found.
C: cd \WampDeveloper\Components\Php deplister ext\php_oci8.dll deplister ext\php_oci8_11g.dll
Everything should be listed as found, and you should not see this:
OCI.dll,NOTFOUND… Which indicates that the Oracle Client DLL is not being found.
Edit php.ini and un-comment:
Save file. Restart Apache.
Then check to make sure this module has been loaded:
* phpinfo.php contains this code:
<?php echo phpinfo(); ?>, and will show you all the loaded PHP extensions and their settings.
PHP Startup: Unable to load dynamic library ‘C:/WampDeveloper/Components/Php/ext\php_oci8_11g.dll’ – %1 is not a valid Win32 application.
This indicates a build-type mismatch.
The used PHP extension (php_oci8_11g.dll) is not matching the PHP build type: 32bits (x86), VC11 (VS.NET 2012), TS (Thread Safe). * TS (Thread Safe) is for Regular PHP; NTS (Not Thread Safe) is for PHP-FCGI.
Chances are you are using the 64-bit build of php_oci8_11g.dll, or a VC9 build, or a NTS build – that replaced the default ext\php_oci8_11g.dll file that PHP came with.
Unable to load dynamic library ‘C:/WampDeveloper/Components/Php/ext\php_oci8_11g.dll’ – The specified module could not be found.
The module is being found (and you can verify that it’s present), but the real problem is that it has dependencies on other DLLs which are not being found.
Update the System’s
PATH Environmental Variable with the Oracle Instant Client’s
OCI.dll file location.
Also make sure PHP’s root folder is in the PATH. * It and PHP’s “\ext” path should already be listed in WampDeveloper’s
%wampdev% environmental variable (which itself is expanded in
* In the error message, the backslash (“\”) being used instead of the “/”, is never the problem.
Oracle Instant Client Version 11 vs. 12
You should use the Oracle Instant Client version that matches the php_oci8 extension version:
Use client version 11 for extension php_oci8_11g.dll
Use client version 12 for extension php_oci8_12c.dll
You can download the oci8 extension for client version 12 from:
The nomenclature of the extension’s file name to built-type is:
- PHP 5.5 32bit: TS, VC11, x86
- PHP-FCGI 5.5 32bit: NTS, VC11, x86
For WampDeveloper’s PHP 5.5 (regular, not FCGI) 32bit channel, you would get this file:
Unzip the contents into PHP “\ext” folder (make sure to overwrite all files), and load it via php.ini:
If your code uses PDO methods to connect to databases, you’ll also need to load this extension: