issues with php5.2.3 and mssql 2005...

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
freaknut
Forum Newbie
Posts: 13
Joined: Thu Aug 16, 2007 9:31 am

issues with php5.2.3 and mssql 2005...

Post 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!
freaknut
Forum Newbie
Posts: 13
Joined: Thu Aug 16, 2007 9:31 am

Post 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?
User avatar
stereofrog
Forum Contributor
Posts: 386
Joined: Mon Dec 04, 2006 6:10 am

Post 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.
freaknut
Forum Newbie
Posts: 13
Joined: Thu Aug 16, 2007 9:31 am

Post 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?
User avatar
stereofrog
Forum Contributor
Posts: 386
Joined: Mon Dec 04, 2006 6:10 am

Post by stereofrog »

Try copying it into c:\windows
freaknut
Forum Newbie
Posts: 13
Joined: Thu Aug 16, 2007 9:31 am

Post 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?
User avatar
stereofrog
Forum Contributor
Posts: 386
Joined: Mon Dec 04, 2006 6:10 am

Post 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.
freaknut
Forum Newbie
Posts: 13
Joined: Thu Aug 16, 2007 9:31 am

Post by freaknut »

I'll do that. Thanks for all your help!
Post Reply