Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Not associated with a trusted SQL Server error

0 views
Skip to first unread message

Brian

unread,
May 28, 2002, 1:46:36 PM5/28/02
to php...@lists.php.net
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.

Brian

unread,
May 29, 2002, 4:55:45 PM5/29/02
to php...@lists.php.net
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" <br...@nextmill.net> wrote in message
news:2002052817463...@pb1.pair.com...

Fili

unread,
Jun 1, 2002, 2:53:42 PM6/1/02
to
Hi Brian, I am trying, really hard, to use php and mysql so I have
decided to put together a system using those technologies. I have
about four years asp/sql server experience.

So far I have decided not to use mysql because it does not support
referential integrity. When I found that out I recalled all the
problems I had with Nucleus, a database engine designed for data
warehousing and therefore stripped from referential integrity. Yes,
very fast serving data, but dangerous on transactional services. The
result is that I am using sql server again but with php.

Today I have started with the php side of my application, and when
writing my very first page I have come across the same problem you
describe with the mssql_connect function. I get a blank page. Life is
short, and although I see the financial advantages of using php and
mysql, I have the feeling of wasting my time.

Can you, or anybody out there, recommend a version of php that is
stable and can work with SQL Server?

Thanks in advance
fili

br...@nextmill.net (Brian) wrote in message news:<2002052920554...@pb1.pair.com>...

0 new messages