0

I'm using the sqlsrv extension to connect to a MSSQL (I think 2005) database using PHP. I'm using a 64-bit Windows 7 machine, XAMPP, PHP 5.3.5, and sqlsrv loads without giving any errors when XAMPP starts and MSSQL queries all work great. It shows up under phpinfo().

The only problem I encounter is when I type in "php -v" to check up on the version in the command line. It says

PHP Startup: Unable to load dynamic library '.../php/ext/php_sqlsrv_53_ts_vc6.dll' (thread-safe and VB 6)

even though the file is there. I'm reading perhaps this is a bit version issue (strange the ext works though?). The SQL driver for PHP is available only in 32-bit it seems (from an 2010 article on one of the MS forums) and it looks like there are some compiling errors if you want to make a 64-bit version yourself. I'm not familiar with compiling PHP into .dll files. Can anybody foresee any problem with this? As I said, it is working right now for SELECT, DELETE, and UPDATE MSSQL queries. TIA for your inputs!

laketuna
  • 3,832
  • 14
  • 59
  • 104

1 Answers1

0

Since PHP 5.3, Microsoft has a new driver for windows :

http://msdn.microsoft.com/en-us/sqlserver/ff657782.aspx

Maybe you can try this version, which seems quite recent (06/2011)

Hope that helps !

Edit : apparently, you need to use PDO for this to work. Is it the case for you ?

Benjamin Dubois
  • 971
  • 7
  • 11
  • that is the version I'm using right now. I'm using the non-PDO version. WHat is PDO? Only the non-PDO works for me. – laketuna Sep 14 '11 at 21:57
  • PDO is the DB abstraction layer of PHP. It is a standard OO interface for database access, which works with most drivers. see here : http://php.net/manual/en/book.pdo.php. For your extension problem, the problem might be related to your php.ini. Are the web and cli executables using the same php.ini file ? There could also be compilation problems (I am no windows expert, but there seem to be specific requirements depending on you php version and target arch : https://wiki.php.net/internals/windows/compiler Hope that leads you to a solution ! – Benjamin Dubois Sep 15 '11 at 19:55