MSSQL

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
colmtourque
Forum Newbie
Posts: 20
Joined: Wed Aug 25, 2004 11:59 am

MSSQL

Post by colmtourque »

I am getting the following error with PHP 5 running on a win2003 server running IIS 6 and MSSQL 8
"
Fatal error: Call to undefined function mssql_connect() in F:\Web\Inetpub\wwwroot\intranet\connect.php on line 2
PHP Warning: PHP Startup: Unable to load dynamic library 'c:\php\ext\php_mssql.dll' - The specified module could not be found. in Unknown on line 0
"
I'm just attempting a simply connection

Code: Select all

$connection = mssql_connect("localhost", "", "");
if ( !$connection ) {
echo ( "Could not connect to msSQL server!" );
exit;
}
The odd thing is I have the latest version of ntwdblib and php_mssql is located at c:\php\ext.
In php.ini I have removed the comment and I have pointed the extensions string to c:\php\ext. I have also tried c:\php\ext\ and c:\\php\\ext\\. I have c:\php and c:\php\ext in my path on the server as well.

Basically I am close to losing my mind, if someone could point out what I have done wrong it would be great. Thanks in advance.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

did you restart IIS?
colmtourque
Forum Newbie
Posts: 20
Joined: Wed Aug 25, 2004 11:59 am

Yes

Post by colmtourque »

and it did not help. Tried on several occassion at that.

I retried though and also discovered this, I uncommented php_mysql.dll an dit is also failing. Strange. This means my ext. are bad. What could cause that?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Run phpinfo(). You may be editing the wrong php.ini. It will tell you where it read the ini from in the top section. If it references the system directory and there isn't a file there, it used the defaults built in and didn't find one in any of the paths. After editing the ini, you can use that to determine if the changes took effect as the extension should be listed later on in the resultant page.
colmtourque
Forum Newbie
Posts: 20
Joined: Wed Aug 25, 2004 11:59 am

I wish :)

Post by colmtourque »

Sadly I was not doing that, each time I made a change to the ini page and refreshed I would get a different path. This problem appears to be more annoying (though I have had that problem in the past :) )
colmtourque
Forum Newbie
Posts: 20
Joined: Wed Aug 25, 2004 11:59 am

Sorry

Post by colmtourque »

Meant to reply sooner but my account kept locking and I got fed up with it.
Took the time to get it fixed and now I'm back in.

I just did a complete reinstall of php and it is working (actually a couple...).
Thanks.
elsint
Forum Newbie
Posts: 7
Joined: Tue Jul 12, 2005 8:22 am

Post by elsint »

Oh my god! At last!

I have the same problem.
I tried many things. Changed extension_dir to all possible combinations.
Added every possible combinations to windows PATH value.

Download programs to look inside DLL's to see what is in php_mssql.dll
And many more things!

But I couldn't get php_mssql.dll worked in Apache.

But at last I found how to get it done!
I copied ntwdblib.dll in c:/php to c:/windows/system32.
This is the solution!

And for your information my extension_dir line is this:
extension_dir = "c:\php\ext"

Also I removed all path entries that I entered to PATH value.
It was so close I would eat my mind and run as far as I can shouting "I hate php_mssql.dll!!!"
Post Reply