Jump to content

[SOLVED] back to square 1 or so it seems


scottybwoy

Recommended Posts

Hi All,

 

The main server at work which I was working from, Died! Damn Hard drives! Luckily I didn't lose all the work, however a full re-install of the system was required.  So I now have php 5.1.4 same as before, IIS 5 Same as before but have upgraded to MS-SQL 2005.

 

php and IIS seem to be running in harmony.  I just dumped my original php.ini in also.

however I can connect to MSSQL via the management console, on Windows Authentication but it doesn't from my script.

 

My script is correct as that is what I have been working on before and it was all working fine.  Any ideas as to what I have missed out?  I receive this error :

 

PHP Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: localhost,1433 in D:\Inetpub\wwwroot\testing\classes\config.inc.php on line 119 PHP Warning: mssql_query() [function.mssql-query]: Unable to connect to server: (null) in D:\Inetpub\wwwroot\testing\classes\mri_central.php on line 20 PHP Warning: mssql_query() [function.mssql-query]: A link to the server could not be established in D:\Inetpub\wwwroot\testing\classes\mri_central.php on line 20 PHP Fatal error: SQL in D:\Inetpub\wwwroot\testing\classes\mri_central.php on line 21

 

From this code : (although I know thats correct, it's not a php prob i know, but this is the best forum)

<?php

function db_conn () {
global $APP_CONN;
if ($APP_CONN = mssql_connect ("localhost,1433", "user", "pass", ""))  <-- Line 119
{
	return mssql_select_db("APP_DB");
} else {
	return false;
}
}

db_conn();

?>

 

Thanks in advance

Link to comment
Share on other sites

Yep that done the trick, thanks.  However I now get this message :

 

PHP Warning: mssql_select_db() [function.mssql-select-db]: message: The server principal "MRI\IUSR_MRI-SERVER" is not able to access the database "mri_sql" under the current security context. (severity 14) in D:\Inetpub\wwwroot\testing\classes\config.inc.php on line 121

 

So I added IUSER_MRI-SERVER to the MSSQL USER group in Active directory, but that didn't do it.  I don't remember doing much else like this before.  Any ideas?

 

What do u mean about that pikemsu28, it should be using Windows Authentication.

Link to comment
Share on other sites

I solved this by working out that the database is using the old authentication groups that didn't exist in the newer Active Directory if anyone is interested.  Setting up new groups and then assigning them to the new MsSQL Server 2005 fixed this issue.

Link to comment
Share on other sites

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.