PHP OCI8 extensions not working with PHP 7 64 bit

oracleoracle-call-interfacePHPwindows

I have installed APACHE 2.4 x64 and PHP7 x64 and download PHP OCI 64bit libraries but the problem is that whenever I run PHP script from cli it says

PHP Startup: Unable to load dynamic library
'E:\software\server\php-7.0.11-Win32-VC14-x64\ext\php_oci8_11g.dll' –
%1 is not a valid Win32 application

Also when I invoke the webapplication from URL it says

Call to undefined function oci_pconnect()

The OCI extension I downloaded are also 64bit. Here is the link:

http://windows.php.net/downloads/pecl/releases/oci8/2.1.2/php_oci8-2.1.2-7.0-ts-vc14-x64.zip

Can someone guide on this problem.

Best Answer

You've probably mixed TS (thread safe) and NTS (non-thread safe) versions. These will not work together. Find out more about PHP thread safety here.

PHP 7.0.11 NTS x64, OCI8 2.1.2 NTS x64, and InstantClient 11.2.0.4.0 x64 work perfectly well together (I've just downloaded these three files and tested them in a fresh Win2K8 environment).

Remember to install the latest VC14 runtime (Visual Studio 2015) and to modify your PATH system environment variable to include the directories of PHP and the InstantClient, e.g. C:\php;C:\instantclient_11_2.

Related Topic