Current location: Hot Scripts Forums » Programming Languages » PHP » Unable to connect to MSSQL with PHP through a firewall


Unable to connect to MSSQL with PHP through a firewall

Reply
  #1 (permalink)  
Old 01-30-04, 08:02 AM
whiplashdomain whiplashdomain is offline
New Member
 
Join Date: Jan 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Question Unable to connect to MSSQL with PHP through a firewall

(note: This thread is currently also in the php-db mailing list right now. I'm just trying to see if anyone else has any solutions elsewhere.)

I've got an odd little problem that I just can't figure out. First, let
me briefly describe my setup:

* Behind a firewall is a Windows 2003 Server running SQL Server 2000 with mixed mode authentication
* On that same internal network is a Linux web server with Apache 2, PHP 4.3.4, FreeTDS, etc.
* The firewall is setup to only allow the external web servers access to specific NAT forwarded ports (1433 TCP, 1434 UDP, 445 TCP)
* At a colocation ISP is another web server running Windows 2000 Server with Apache 2, PHP 4.3.3, etc.

I've written a script that connects to the SQL server for simple authentication and tracking. This script was developed on the internal Linux box. Everything works fine on this server: connecting, authenticating, queries, etc.

Running the same script on the external Windows box isn't working as well, though. Apache and PHP run just fine on this box with other scripts, but connecting to the SQL server through the firewall with the same script and settings, except for the IP address of the server (since we are connecting to the firewall's NAT'd ports), but I consistantly receive the following error:

Login failed for user 'JoeShmoe'. Reason: Not associated with a trusted SQL Server connection.

I'm thinking either there is a problem with the SQL server's settings somewhere, I don't know), or PHP on the external webserver, but I'm not sure what to do. I've looked all over the configurations for both servers and they look fine, checked several sites and lists for advice and couldn't find anything that would work.

Any ideas as to what I should be looking for?
Reply With Quote
  #2 (permalink)  
Old 01-31-04, 07:17 PM
whiplashdomain whiplashdomain is offline
New Member
 
Join Date: Jan 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Okay, the problem was the MSSQL Client Tools wasn't installed. Once it was installed script connected perfectly.

What I had done prior to installing the MSSQL Client Tools was copied ntwdblib.dll from the SQL Server to the Web Server. According the the PHP documentation for Microsoft SQL Server functions <http://php.net/mssql> this was one of two ways of getting mssql functions to work, the other being installing the Client Tools. I had not installed it initially due to the shear size of the installer I was required to upload to the server, so I opted for just the DLL.

Apparently I was wrong, but perhaps the documentation needs to be reworded to reflect that the Client Tools is the only way to get these functions to work properly.Thanks for the help.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP and MySQL ? rob2132 Hot Scripts Forum Questions, Suggestions and Feedback 4 08-29-08 02:22 AM
100 Web Templates & 10 PHP Scripts for sale! HostersUK.co.uk General Advertisements 0 01-10-04 12:31 AM
Question about dreamweaver and php? chinablack1480 PHP 0 12-07-03 10:16 PM
I need help with my first php script NeverMind PHP 4 08-01-03 01:27 PM


All times are GMT -5. The time now is 08:09 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.