0

I have been trying to initiate database trusted connection to MS SQL using PHP but failed. My PHP development machine is not part of the domain and the MS SQL server is in a domain. Unfortunately I cannot join my development machine to the domain. My DBA is reluctant to change the authentication mode of the SQL server.

Is there anyway for me to connect to the MS SQL server with trusted connection using PHP with just a domain logon credential?

Thank you

cheetooh
  • 16
  • 2

1 Answers1

0

In Asp.net we can use Integrated Security=True";or Trusted_Connection=Yes;in your connection string or Trusted Connection=SSPI" in connection string

in php go to the php.ini and verify the mssql.secure_connection parameter :

[MSSQL]

mssql.secure_connection = On
Arunprasanth K V
  • 20,733
  • 8
  • 41
  • 71
  • Thanks Arun but my script is a PHP script. How do I add that? – cheetooh Nov 24 '14 at 05:36
  • @cheetooh sorry i mentioned only asp.net case, chek my updated ans it will deals php windows authentication too – Arunprasanth K V Nov 24 '14 at 05:49
  • Thanks for your reply again! Sorry forgot to mention I am running PHP on IIS 7.5. I found the setting in php.ini file and I have changed it. Then, I changed the Anonymous Authentication to a valid domain user login credential. But I am getting the error >Login failed for user ''. The user is not associated with a trusted SQL Server connection – cheetooh Nov 24 '14 at 06:02
  • This problem occurs if the user tries to log in with credentials that cannot be validated. because of more than one resons the same error may occur. anyway try the following. open your sql server management studio then open Object explorer then ight click on Server Node and select Properties then go to Security Tab and go to Server Authentical Area. then Select SQL Server and Windows Authentication Mode. and press ok then try to connect – Arunprasanth K V Nov 24 '14 at 06:09