mssql problems, iis not working

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
curiousTek
Forum Newbie
Posts: 5
Joined: Fri Feb 04, 2005 11:44 am

mssql problems, iis not working

Post by curiousTek »

Hello everyone,

When I enable MSSQL with PHP my webservice (iis) stops working, wont serve any files .html, .asp anything.

I did the following

Copied ntwdblib.dll into c:\windows, c:\windows\system32, and c:\php
Copied php_mssql.dll from c:\php\ext, to c:\windows, and c:\windows\system32

removed ; from php.ini for line extension=php_mssql.dll

restarted IIS, and BOOM! nothing works, when I add the ; to extension=php_mssql.dll again and restart it works again...

Can't find any posts of people having the same problem, im using php-cgi.exe to read my php files.

Please help!
Thank you,
curiousTek
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

have you tried running php in ISAPI? Checked the error logs to see if it didn't start correctly?
curiousTek
Forum Newbie
Posts: 5
Joined: Fri Feb 04, 2005 11:44 am

Post by curiousTek »

No I havent tried running in ISAPI, which dll do I use for that?

I checked my evenlog only thing I could find was this:

Code: Select all

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


For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
IIS started up fine, didnt get a error till I tried to view a page on the site. Received the error: Service Unavailable
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

it would appear that you didn't copy php_mssql.dll to c:/php5/ ...
curiousTek
Forum Newbie
Posts: 5
Joined: Fri Feb 04, 2005 11:44 am

Post by curiousTek »

Ok, looking at the error it said it was looking for c:\php5\ indead of c:\php

copied the php extentions to c:\php5 and now its working, cant find a line in php.ini that is telling it go there, any ideas on how to make it goto c:\php\ext instead?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I would imagine setting the "extension_dir" directive in the ini would do it.
curiousTek
Forum Newbie
Posts: 5
Joined: Fri Feb 04, 2005 11:44 am

Post by curiousTek »

ok, now iis and php seem to be work, all scripts but this one are working. This is returning

No input file specified.

Code: Select all

<?php

$myServer = "localhost";
$myUser = "sa";
$myPass = "pass";
$myDB = "visits";

$s = @mssql_connect($myServer, $myUser, $myPass)
or die("Couldn't connect to SQL Server on $myServer");

$d = @mssql_select_db($myDB, $s)
or die("Couldn't open database $myDB");

$query = "INSERT INTO hits (ip, uagent, referer_page, visited_page)";
$query .= "VALUES ($REMOTE_ADDR, $HTTP_USER_AGENT, $HTTP_REFERER, $PHP_SELF)";

$result = mssql_query($query);
$numRows = mssql_num_rows($result);

echo "<h1>" . $numRows . " Row" . ($numRows == 1 ? "" : "s") . " Returned </h1>";

while($row = mssql_fetch_array($result))
&#123;
echo "<li>" . $row&#1111;"Hit_IP"] . "</li>";
&#125;

?>
Post Reply