Page 1 of 1

issues with php5.2.3 and mssql 2005...

Posted: Thu Aug 16, 2007 11:15 am
by freaknut
I'm running Windows Server 2003, PHP 2.3.5 and IIS6. I've been trying to install a forum (PHPBB), but I'm having issues with it. When consulting the php error log, I read the following:

PHP Warning: PHP Startup: Unable to load dynamic library 'C:\PHP5\ext\php_mssql.dll' - The specified module could not be found.

in Unknown on line 0



The file is there. I've double and triple checked the spelling of the directories and .dll file. The php.ini file has the mssql extension enabled and pointing to the correct location as well (I figured that was obvious since the error log says it's actually looking for the file, but I wanted to clarify).

Any thoughts? Thanks!

Posted: Thu Aug 16, 2007 1:26 pm
by freaknut
I've gone through the install instructions for php_mssql.dll in the php manual, and came across one item I don't understand...
The MSSQL extension is enabled by adding extension=php_mssql.dll to php.ini.

To get these functions to work, you have to compile PHP with --with-mssql[=DIR], where DIR is the FreeTDS install prefix. And FreeTDS should be compiled using --enable-msdblib.
I don't get the part that's bolded. What am I supposed to do?

Posted: Thu Aug 16, 2007 2:11 pm
by stereofrog
This is for unix only, on windows you don't have to bother compiling anything. ;)
The error message you got probably means php_mssql is unable to find one of the libraries it is linked against, most likely ntwdblib.dll. Make sure it's in your path.

Posted: Thu Aug 16, 2007 2:56 pm
by freaknut
I had already checked for that .dll before. It was only in the php root folder, so I added it to the \ext\ folder as well (not sure if it needs to be there or not). Didn't make a difference.

Is there anything that phpinfo() can tell about the problem?

Posted: Thu Aug 16, 2007 3:00 pm
by stereofrog
Try copying it into c:\windows

Posted: Thu Aug 16, 2007 3:04 pm
by freaknut
Yay, that worked.

Why is it looking for it in the windows folder? Is it because my php.ini file is also being loaded from there?

Posted: Thu Aug 16, 2007 3:26 pm
by stereofrog
This is because dlls are looked for in PATH and your php directory is probably not there.

For the future (and for your other problem) I highly recommend installing FileMon and RegMon utilities from sysinternals (http://www.microsoft.com/technet/sysinternals). They are very helpful in finding out which files and registry keys your system is looking for.

Posted: Thu Aug 16, 2007 3:54 pm
by freaknut
I'll do that. Thanks for all your help!