Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I need to get the mssql_connect function available on a machine, and would like to load a newer php distro than 5.2.x

Does anyone know if it is possible to somehow load this driver on aWindows 7(x64) box, using php 5.3 VC9 ?

Googling around led me to believe that it is possible, but the obvious

[PhP_MSSQL(EXPERIMENTAL!!)]
extension=php_mssql.dll

Inclusion in the php.ini file only leads to an error

PHP Startup: Unable to load dynamic library 
'C:\Program Files (x86)\PHP\ext\php_mssql.dll'
- The specified module could not be found.
in Unknown on line 0

Including the ntwdblib.dll lead me to this error:

PHP Warning:  PHP Startup: mssql: Unable to initialize module
Module compiled with build ID=API20090626,TS,VC6
PHP    compiled with build ID=API20090626,TS,VC9
These options need to match
share|improve this question
    
Any reason you can't use the MS sanctioned/developed MS SQL PHP drivers (php_sqlsrv.dll)? Or do you have a codebase littered with code using this older lib? –  Kev Feb 28 '12 at 13:42
    
Codebases are fun things... –  Alex Feb 28 '12 at 13:45
add comment

2 Answers

The clue to the problem is in the error message:

PHP Warning:  PHP Startup: mssql: Unable to initialize module
Module compiled with build ID=API20090626,TS,VC6
PHP    compiled with build ID=API20090626,TS,VC9
These options need to match                         <---- the reason

You're running a build of PHP built with the VC9 toolchain. The php_mssql.dll DLL you have is built using the VC6 toolchain.

You can't mix them.

share|improve this answer
add comment
up vote 0 down vote accepted

http://docs.moodle.org/20/en/Installing_MSSQL_for_PHP seems to have a FreeTDS driver for 5.3 VC9, so that seems to have solved my problems. It works too!

I have no doubt it will one day break deep down inside, on some obscure and complex function though.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.