Search code examples
php-7

Unable to load dynamic library php_sqlsrv_7_nts.dll is not a valid Win32 application


Thought I'd see if there were any sql server drivers for php 7. Another question on Stack Overflow pointed me to these drivers here

So I install php_sqlsrv_7_nts.dll into my ext folder and add the following line to my php.ini:

extension=php_sqlsrv_7_nts.dll

I get this warning on every php script I run:

Warning: PHP Startup: Unable to load dynamic library 'C:\php7\ext\php_sqlsrv_7_nts.dll' - %1 is not a valid Win32 application

I realise this is just a pre-release version and there are many things to iron out still, but I was hoping to at least do some basic things.

What am I doing wrong, or do I need to wait a bit more for a better release.

Some info that might be useful:

PHP Version => 7.0.5

System => Windows NT GB275L-I-T-5654 6.3 build 9600 (Windows 8.1 Professional Edition) i586
Build Date => Mar 30 2016 09:57:56
Compiler => MSVC14 (Visual C++ 2015)
Architecture => x86
Configure Command => cscript /nologo configure.js  "--enable-snapshot-build" "--enable-debug-pack" "--disable-zts" "--with-pdo-oci=c:\php-sdk\oracle\x86\instantclient_12_1\sdk,shared" "--with-oci8-12c=c:\php-sdk\oracle\x86\instantclient_12_1\sdk,shared" "--enable-object-out-dir=../obj/" "--enable-com-dotnet=shared" "--with-mcrypt=static" "--without-analyzer" "--with-pgo"

Solution

  • Finally got this solved. Needed to install some more things before it would work, namely:

    1. Microsoft Visual C++ 2015 Redistributable (x86) which you can get from here

    2. The ODBC drivers which you can get from here