SQLSRV for PHP 5.5 x64

Oct 23, 2013 at 9:19 PM
Hey guys,

I'm trying to compile SQLSRV for PHP 5.5 x64 and I'm getting this:
main\internal_functions.c(45) : error C2065: 'phpext_sqlsrv_ptr' : undeclared identifier
main\internal_functions.c(45) : error C2099: initializer is not a constant
main\internal_functions.c(48) : error C2065: 'phpext_pdo_sqlsrv_ptr' : undeclared identifier
main\internal_functions.c(48) : error C2099: initializer is not a constant
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0
\VC\BIN\amd64\cl.exe"' : return code '0x2'
Stop.
Any ideas what can be done to solve that?
Oct 24, 2013 at 1:13 AM
Before you tell me that PHP 5.5 x64 is still experimental, I'm asking because I have been compiling other extensions like IBM DB2 and others and they have all compiled without any issues, SQLSRV is the only one that has given me this problem.

Thanks
Oct 24, 2013 at 9:39 AM
Somebody has already done a 64-bit build for 5.5, why not use theirs? It's on the forum, just do a Google search.

Microsoft has quite clearly stated that the current driver is 32-bit, so some work is needed in a few places to make it compile.
Nov 1, 2013 at 12:04 PM
If you know where to find it please share. Thank you.
Jul 30, 2014 at 9:40 PM
Edited Jul 30, 2014 at 9:44 PM
I looked for it everywhere, nothing found and I'm still getting:
ext\sqlsrv\core_stmt.cpp(1994) : __error C2664__: 'convert_string_from_utf16' : cannot convert parameter 3 from 'SQLLEN' to 'SQLINTEGER &'
ext\sqlsrv\core_stmt.cpp(2006) : warning C4244: 'initializing' : conversion from 'SQLLEN' to 'int', possible loss of data
ext\sqlsrv\core_stmt.cpp(2119) : warning C4244: 'initializing' : conversion from 'SQLLEN' to 'SQLINTEGER', possible loss of data
ext\sqlsrv\core_stmt.cpp(2130) : __error C2664__: 'sqlsrv_result_set::get_data' : cannot convert parameter 5 from 'SQLINTEGER *' to 'SQLLEN *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
ext\sqlsrv\core_stmt.cpp(2157) : __error C2664__: 'sqlsrv_result_set::get_data' : cannot convert parameter 5 from 'SQLINTEGER *' to 'SQLLEN *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
ext\sqlsrv\core_stmt.cpp(2183) : __error C2664__: 'convert_string_from_utf16' : cannot convert parameter 3 from 'SQLLEN' to 'SQLINTEGER &'
ext\sqlsrv\core_stmt.cpp(2227) : __error C2664__: 'convert_string_from_utf16' : cannot convert parameter 3 from 'SQLLEN' to 'SQLINTEGER &'
ext\sqlsrv\core_stmt.cpp(2380) : warning C4244: 'initializing' : conversion from 'SQLLEN' to 'int', possible loss of data
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\BIN\amd64\cl.exe"' : return code '0x2'
I definitely don't think this error is coming from PHP but from something wrong in sqlsrv code.
Jul 31, 2014 at 11:02 AM
Message for dann23:
The forum I mentioned is one by MSFT for their sqlsrv PHP drivers, here: (quick Google for "sqlsrv php forum" will find it):
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/home?forum=sqldriverforphp

However, I apologise because I searched it for 64 bit drivers and couldn't actually find any, even though there are some posts with 64-bit in the title.

I have done some builds with modifications and bug fixes here, the details of which are explained in the post:
http://robsphp.blogspot.co.uk/2012/06/unofficial-microsoft-sql-server-driver.html