Jump to content

PHP, IIS7, MSSQL Oh My! Can Connect with CLI but not in browser


rocksolidhq

Recommended Posts

Hey,

 

i'm getting the usual error "mssql_connect() [function.mssql-connect]: Unable to connect to server" but only in the browser. If i run the script from the command line it works fine and retrieves the info.  :wtf:

 

The system is a 64-bit Windows 7 box with IIS 7 and PHP 5.2.10. i've got the right ntwdblib.dll. i've got version 2000.80.194.0 in place right now and i've also had 2000.2.8.0 had it i PHP folder as well as in the Windows folder. I pulled my version 2000.2.8.0 from another server (2003 with IIS6) where it is working as expected.  With any combination of the above, the CLI works fine but the browser give me the unable to connect to server error.

 

My phpinfo() shows me that it has mssql loaded and further i know that it is loaded as it doesn't toss an error about an unknown function call for mssql_connect. i'm using PHP's ISAPI module. Not sure if switching to FastCGI would make any difference.

 

Can anyone please suggest anything else that i need to check? I'm guessing that it's an IIS7 config issue since the CLI works. Basically i created the ISAPI filter (Name: PHP, Executable: C:\Program Files\PHP\php5isapi.dll) and then the Module Mapping (Request Path: *.php, Module: ISAPI Module, Executable: C:\Program Files\PHP\php5isapi.dll, Name: PHP ISAPI), clicked "Yes" after creating the module and enabled 32-bit applications in the DefaultAppPool.

 

please help!!

Link to comment
Share on other sites

Hey All,

 

  Finally got it figured out so i thought i'd post back in case someone else has the same problem.  i'm not sure i understand the reasoning here either so if anyone can shed some additional light i would be grateful.

 

  To resolve this i selected the site, in my case the Default Web Site, and went into the website's "Basic Settings" (in the right column).  In there i clicked the "Connect As" button and entered the administrator username and password.

 

  i'd love an explaination of the overall effect of this change.  Does it create any security problems?

 

thanks,

dean

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.