Jump to content

Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'. (severity 14) Please help!


Recommended Posts

Hi everybody,

I have a problem (and also not good at english!), I am trying to put few interactive pages to the site of our organization. The datas for these pages are expected to be taken from SQL Server2000. I've installed Apache 1.3.33+PHP 5.2. Then I made a connection, seems working till the message saying that the connection with SQL doesn't work. I've commented all nesesarry libraries, and copied them were necessary... when I launch the skrypt of connection test with SQL, there just simple request shown below:

ini_set( 'display_errors' , '1' );
error_reporting(E_ALL);
$myServer = "sql";
$myUser = "sa";
$myPass = "haomovarga187";
$myDB = "spec";

$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 = "SELECT FirstName AS Employee ";
$query .= "FROM Expert  ";
$query .= "WHERE Id = '2'";

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

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

while($row = mssql_fetch_array($result))
{
echo "<li>" . $row["Employee"] . "</li>";
}

>>>>So, when I launch  that scrypt in PHP Expert Editor there is no problem with connection (means it gives the result of request). But when I am saving it in the root folder of Web-server to launch in the explorer and trying to launch it in brauser it gives:


Warning: mssql_connect() [function.mssql-connect]: message: Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'. (severity 14) in C:\www\html\Index.php on line 18

Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: sql in C:\www\html\Index.php on line 18
Couldn't connect to SQL Server on sql

I am launching the script from my PC (in my office), and SQL Sikwell is on another PC, but I've tryed to launch the script locally, installed the SQL to my PC and tryed to launch but the result was same.
Web server Apache +PHP are on one PC, and editor is also there, it's much easy for me to write neither on Notepad, when I am launching a scrypt from the editor. SQL is in local networl. I am saving it in the webserver folder and launching it in brauserr http://localhost/Index.php and there it doesn't work.

I've already spoken with all russian-speaking collegues however they couldn't help me. Has anybody any idea to solve this problem? I've spended already 2 weeks trying to solve this!
Please help!

Had a look around about this problem and I might have found a solution at [url=http://www.issociate.de/board/post/219822/PHP_MSSQL_connection_problem..html]http://www.issociate.de/board/post/219822/PHP_MSSQL_connection_problem..html[/url].

Particularly this bit...

[quote]
So ... for anyone easy that is have the same problem, I made the follow
registry entry on my local server:

HKEY_LOCAL_MACHINE\SOFTWARE\M=ADicrosoft\ MSSQLServer\Client\ConnectTo]
DSQUERY=3DDBNETLIB

and then in my php.ini in the MSSQL area I set:

mssql.secure_connection =3D Off
[/quote]

Not sure if you'll have authority to make those changes on the server - and DEFINITELY can't vouch for their security (not a Windows guru), but it seemed to work for that guy.

BTW, I don't know if that's your real DB username and password, but it's generally good policy not to post it - even if the chances of someone knowing your server address are unlikely!  :)
Thank you for your reply. However, I've done all this settings... and have seen all links concerning this problem in English and Russian... so I need only advices)))


[quote author=bqallover link=topic=123789.msg512137#msg512137 date=1169631998]
Had a look around about this problem and I might have found a solution at [url=http://www.issociate.de/board/post/219822/PHP_MSSQL_connection_problem..html]http://www.issociate.de/board/post/219822/PHP_MSSQL_connection_problem..html[/url].

Particularly this bit...

[quote]
So ... for anyone easy that is have the same problem, I made the follow
registry entry on my local server:

HKEY_LOCAL_MACHINE\SOFTWARE\M=ADicrosoft\ MSSQLServer\Client\ConnectTo]
DSQUERY=3DDBNETLIB

and then in my php.ini in the MSSQL area I set:

mssql.secure_connection =3D Off
[/quote]

Not sure if you'll have authority to make those changes on the server - and DEFINITELY can't vouch for their security (not a Windows guru), but it seemed to work for that guy.

BTW, I don't know if that's your real DB username and password, but it's generally good policy not to post it - even if the chances of someone knowing your server address are unlikely!  :)
[/quote]
Ladies and gentlmens!

Thank you in advance for help and assistance but please, notice one thing! I'VE LOOKED ALL LINKS IN INTERNET CONCERNING THIS PROBLEM AND FOUND NOTHING AND NOW I NEED ADVICE OR PROBABLE SOLUTION.

Thank you! ;)
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.