Php_sqlsrv_56_ts.dll' - %1 is not a valid win32 application.

error occurs when run code in php php_sqlsrv_56_ts.dll' - %1 is not a valid win32 to solve this

Answer 1

you must consider you OS architecture and php architecture. try to use same type of file x86 or x64. and also php_sqlsrv_56_ts.dll and php_sqlsrv_56_nts.dll have more differences. use corresponding file. Refer window download page. this site provide two type of php packeges

  • ts
  • nts
Some times you need to use x64 DLL files in ext folder, because your PHP and OS arch may be differ.
Try to download both 32 and 64 bit files and test.

php_sqlsrv files are available on Microsoft official website.

Answer 2

  • First know you are using ts or nts,
  • Know 32 or 64 bit you are use.
  • Know OS arch and PHP arch differ or not, if differ try to replace 32 to 64 and 64 to 32 may be its work.
  • try  php_sqlsrv_56_ts.dll -> 56 is 5.6 PHP vartion, TS is type
  • Alternate way use PDO,easy to use. 
  • use 7.0 its working 

Answer 3

PHP VC14 x86 Non Thread Safe (2017-Mar-16 00:33:22)  - NTS 32 Bit

PHP VC14 x86 Thread Safe (2017-Mar-16 00:33:23) - TS 32 Bit

VC14 x64 Non Thread Safe (2017-Mar-16 00:33:21) - NTS 64 Bit

VC14 x64 Thread Safe (2017-Mar-16 00:33:21) - TS 64 Bit

Answer 4

Download DLL from for all SQL Server Connection DLL.

Answer 5

First know you install Driver for SQL, The Microsoft ODBC Driver for SQL Server provides native connectivity from Windows

Answer Question