Page 1 of 1

mssql problems, iis not working

Posted: Fri Feb 04, 2005 11:51 am
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

Posted: Fri Feb 04, 2005 11:55 am
by feyd
have you tried running php in ISAPI? Checked the error logs to see if it didn't start correctly?

Posted: Fri Feb 04, 2005 12:17 pm
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

Posted: Fri Feb 04, 2005 12:21 pm
by feyd
it would appear that you didn't copy php_mssql.dll to c:/php5/ ...

Posted: Fri Feb 04, 2005 12:22 pm
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?

Posted: Fri Feb 04, 2005 12:38 pm
by feyd
I would imagine setting the "extension_dir" directive in the ini would do it.

Posted: Fri Feb 04, 2005 12:58 pm
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;

?>