I’m new to PHP and have run into a rather simple yet annoying issue.
Here is the setup:
- Windows domain environment
- Users connect to a local server 2008 box running IIS7 and latest
version of PHP - This box houses the php scripts which connect to a local mssql server
If the users navigate to http://iisservername/ and try to connect to the mssql server via the php scripts, they receive Login failed for user NT AUTHORITY\ANONYMOUS LOGON
My workaround has been to launch a cmd script on the IIS server that uses runas /profile /user:domain\user “c:\program files\internet explorer\iexplore.exe”
I create a runas line for each user in the cmd script and execute it.
Upon launch, it navigates to homepage, which is a keepalive.php script I made that opens a connect and then javascript refreshes the page every x amount of minute(s).
Surely there is a better way to do this, yes?
if you use sqlsrv_connect and are using IIS’s built in authentication it should be handled for you with nothing more then:
(example from: http://msdn.microsoft.com/en-us/library/cc296205%28v=sql.90%29.aspx)