PDA

Click to See Complete Forum and Search --> : I think I may be stupid


ober0330
Jul 12th, 2004, 10:41 AM
Ok, so here's the situation:

I have an MS SQL Server which is a test server for my development needs (as most of you know). I have Apache, PHP, MSSQL and some other things installed on there. A couple months ago, I started using a different server for the web server. PHP was also installed there and that is an IIS ( :eek: ) server. Everything has been working fine until my next move. I'm moving my tables/DTS/logins (the whole shebang) to a production MS SQL server.

This is where we hit problems. I can move the data just fine and all that works. I've even made an ODBC connection to that server with a login/pass that was given to me. However, I cannot use the PHP calls to connect to the server.

Here's where I get stupid, or so I think: Does PHP need to be installed on that server that houses the MS SQL Server? Currently it is not and I think that is the problem we are having. Can anyone confirm or deny the need for that action (installing PHP on the production server)?

plenderj
Jul 13th, 2004, 04:26 AM
No you don't need PHP on the server. PHP can pull the data from any odbc compliant device or server - and that device or server does not need php itself. Is your connection string okay? Can you even connect to the DB from php?

ober0330
Jul 13th, 2004, 07:12 AM
The connection string is fine AFAIK. I used the same setup on my test server and it worked great. All I did was change the name of the server (IP), and use the username/password that was setup. I can use ODBC to connect to it, but PHP will not find it no matter what I do.

The only other problem I could see is that the server is a cluster. I don't know that that would be a problem, but it's my only other guess at this point.

ober0330
Jul 13th, 2004, 07:24 AM
Here is my connection file:
Other than my built in errors via die statement, no.

Here is my code:

$myServer = "xxx.xxx.xxx.xxx";
//$myServer = "xxx.xxx.xxx.xxx";
$myUser = "labuser";
$myPass = "helab";
$myDB = "CellHours";

$s = mssql_connect($myServer, $myUser, $myPass)
or die("<br/><br/><br/><p class=warn>Couldn't connect to SQL Server on $myServer<br/><br/><p class=other>Please contact system administrator or try again later.");

$d = mssql_select_db($myDB, $s)
or die("<br/><br/><br/><p class=warn>Couldn't open database $myDB<br/><br/><p class=other>Please contact system administrator or try again later."); Obviously, I've changed the IP to x's. This works on my test server just fine... I don't think there should be any reason that it doesn't work on the production server.

plenderj
Jul 14th, 2004, 06:21 AM
Is that user added to that database in enterprise manager on your production server?

ober0330
Jul 14th, 2004, 06:48 AM
Yes, and like I said, I can use that login information with an ODBC connection and it works just fine.