I removed some 'security' settings that Microsoft had recommended which had
prevented Named Pipe connections to our Microsoft SQL server.  Basically
requiring everyone to use TCPIP connections.  Which is very simple when
using a system DSN or ADODB or any number of ASP connection types.  But the
latest version of PHP 4.2.1 seems to have a bug in mssql.connect where it
DOES NOT use TCPIP connection, it for some reason always wants to use Named
Pipes, even when you use a FQDN,1433 which should force it to use TCPIP.  I
don't know why, and since PHP is free, there really isn't a single company
in charge of fixing such a problem.

Registry settings set back to:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\LSA]
"RestrictAnonymous"=dword:00000000

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanManServer\Parameter
s]
"RestrictNullSessAccess"=dword:00000000

The following Registry Settings on SQL 2000 server caused PHP 4.2.1
mssql.connect to fail a connection even though ASP pages and ODBC.connect
using a system DSN configured to use TCPIP had no problem

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\LSA]
"RestrictAnonymous"=dword:00000002

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanManServer\Parameter
s]
"RestrictNullSessAccess"=dword:00000001

"Brian" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Server : sql 2000 sp2 in SQL authentication mode
>
> If I run c:\php\php.exe test1.php it produces the correct html output
> displaying the rows. Which means SQL is functioning with the username/pw
> configuration in the php code.
> But if called THRU Internet Service manager, the exact same test1.php
file,
> I get this:
>
> PHP Warning: MS SQL message: Login failed for user 'sa'. Reason: Not
> associated with a trusted SQL Server connection. (severity 14) in
> c:\websites1\killer5.nextmill.net\test1.php on line 36 PHP Warning: MS
SQL:
> Unable to connect to server: killer6.nextmill.net,1433 in
> c:\websites1\killer5.nextmill.net\test1.php on line 36 PHP Warning:
Supplied
> argument is not a valid MS SQL-Link resource in
> c:\websites1\killer5.nextmill.net\test1.php on line 37 PHP Warning:
Supplied
> argument is not a valid MS SQL-Link resource in
> c:\websites1\killer5.nextmill.net\test1.php on line 38 PHP Warning:
Supplied
> argument is not a valid MS SQL-result resource in
> c:\websites1\killer5.nextmill.net\test1.php on line 39 PHP Warning:
Supplied
> argument is not a valid MS SQL-result resource in
> c:\websites1\killer5.nextmill.net\test1.php on line 60
>
>
> The code is below:
> $db = mssql_connect("killer6.nextmill.net,1433", "sa", "*******");
(removed
> for security)
> mssql_select_db("EDSLdbase",$db);
> $result = mssql_query("SELECT * FROM test",$db);
> $total = mssql_num_rows($result);
> ?>Total number of entries in database:<b> <?php
> echo $total;
> printf("%s,%s-%s-%s,%s,%s\n<br>", $myrow[0], $myrow[1], $myrow[2],
> $myrow[3], $myrow[4], $myrow[5]);
>
>
> ________________________________
>
> What is weird is it works in a CMD prompt, but if called thru IIS 5, it
> displays the error running PHP 4.1.2, if I use PHP 4.2.1, I get no error
but
> no display of the content either.
> This WAS working on 4.0.4 before the server was upgraded to 4.2.1 and then
> tested on another server using 4.1.2
> Any ideas?  BTW, this sql server is configured to only allow TCPIP
> connections, no named pipes, but that hasn't been an issue with the 4.0.4
> config in the past.
>
>
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to