Board index   FAQ   Search  
Register  Login
Board index PHP PHP Installation

Can connect to MSSQL from CLI but not in browser??

Forum for you who has PHP installation issues

Moderators: macek, egami, gesf

Can connect to MSSQL from CLI but not in browser??

Postby rocksolidhq » Fri Nov 26, 2010 4:10 am

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. :-x

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!!
rocksolidhq
New php-forum User
New php-forum User
 
Posts: 2
Joined: Fri Nov 26, 2010 3:29 am

Re: Can connect to MSSQL from CLI but not in browser??

Postby rocksolidhq » Fri Nov 26, 2010 10:44 am

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
rocksolidhq
New php-forum User
New php-forum User
 
Posts: 2
Joined: Fri Nov 26, 2010 3:29 am


Return to PHP Installation

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.