scottybwoy Posted April 12, 2007 Share Posted April 12, 2007 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 Quote Link to comment Share on other sites More sharing options...
only one Posted April 12, 2007 Share Posted April 12, 2007 maybe the server port was changed during the reinstalation, thats all i can think of Quote Link to comment Share on other sites More sharing options...
pikemsu28 Posted April 12, 2007 Share Posted April 12, 2007 make sure the user name and password is stored in the database as well. i made this mistake once when i reinstalled everything. Quote Link to comment Share on other sites More sharing options...
scottybwoy Posted April 12, 2007 Author Share Posted April 12, 2007 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. Quote Link to comment Share on other sites More sharing options...
scottybwoy Posted April 13, 2007 Author Share Posted April 13, 2007 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.