473,326 Members | 2,128 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

mssql_connect() Problems

I have a server with Windows 2000, PHP 5, IIS and SQL Server 2000
running. Individually, each works great. When trying to bring PHP and
MSSQL together, though, I'm tearing my hair out...it just will not
connect. Not even an error message.

Consider the code:

<?php
$server = "localhost"; // have also tried "[servername]", "localhost:
1433" and "[servername]:1433"
$username = "administrator"; // Windows username
$password = "[password]";
if (!mssql_connect($server, $username, $password))
echo "Could not connect.<p>";
?>

When thinking about all the things I've tried based on the wisdom of
the Internet, I'm stunned it still doesn't work:
* Upgraded the ntwdblib.dll file that PHP uses to 8.0.194, the latest
version
* Configured php.ini such that mssql.secure_connection = On [was Off
for awhile]
* Telnet-ed into the SQL server...telnet [servername].case.edu 1433'
produces a positive response.
* Confirmed a zillion times that the MSSQL extension is functional.

Any ideas? If I don't fix this, I have to learn ASP in 24 hours.

Thanks.

Apr 24 '07 #1
6 13077
sp*******@gmail.com wrote:
I have a server with Windows 2000, PHP 5, IIS and SQL Server 2000
running. Individually, each works great. When trying to bring PHP and
MSSQL together, though, I'm tearing my hair out...it just will not
connect. Not even an error message.
use Linux... :)

--
iTech Consulting Services Limited
Expert of ePOS solutions
Website: http://www.itech.com.hk (IE only)
Tel: (852)2325 3883 Fax: (852)2325 8288
Apr 24 '07 #2
TMM
On Mon, 23 Apr 2007 20:57:45 -0700, spamguy21 wrote:
I have a server with Windows 2000, PHP 5, IIS and SQL Server 2000
running. Individually, each works great. When trying to bring PHP and
....
<?php
$server = "localhost"; // have also tried "[servername]", "localhost:
1433" and "[servername]:1433"
I've tried to run mssql express like this and that connection faile until
I entered the correct "path" (I'm really unsure here, what to call it) to
the server. I also never got use for the port, when I did this:

$config['Database']['server'] = 'HOST\SQLEXPRESS';

After this, the connection worked all fine, except for the user-rights I
had to fix first.

Apr 24 '07 #3
TMM
On Mon, 23 Apr 2007 20:57:45 -0700, spamguy21 wrote:

I have a server with Windows 2000, PHP 5, IIS and SQL Server 2000
running. Individually, each works great. When trying to bring PHP and
...

<?php
$server = "localhost"; // have also tried "[servername]", "localhost:
1433" and "[servername]:1433"
I've tried to run mssql express like this and that connection failed until
I entered the correct "path" (I'm really unsure here, what to call it) to
the server. I also never got use for the port, when I did this:

$config['Database']['server'] = 'HOST\SQLEXPRESS';

After this, the connection worked all fine, except for the user-rights I
had to fix first.
Apr 24 '07 #4
sp*******@gmail.com wrote:
I have a server with Windows 2000, PHP 5, IIS and SQL Server 2000
running. Individually, each works great. When trying to bring PHP and
MSSQL together, though, I'm tearing my hair out...it just will not
connect. Not even an error message.
Have you looked at the event viewer? If you didn't specify for PHP to
log to a file, that's where the errors go...
>
Consider the code:

<?php
$server = "localhost"; // have also tried "[servername]", "localhost:
1433" and "[servername]:1433"
$username = "administrator"; // Windows username
$password = "[password]";
if (!mssql_connect($server, $username, $password))
echo "Could not connect.<p>";
?>
I don't know about MSSQL, but shouldn't you use a MSSQL user (as opposed
to a windows user)?

Apr 24 '07 #5
On Apr 23, 11:57 pm, spamgu...@gmail.com wrote:
I have a server with Windows 2000, PHP 5, IIS and SQL Server 2000
running. Individually, each works great. When trying to bring PHP and
MSSQL together, though, I'm tearing my hair out...it just will not
connect. Not even an error message.

Consider the code:

<?php
$server = "localhost"; // have also tried "[servername]", "localhost:
1433" and "[servername]:1433"
$username = "administrator"; // Windows username
$password = "[password]";
if (!mssql_connect($server, $username, $password))
echo "Could not connect.<p>";
?>

When thinking about all the things I've tried based on the wisdom of
the Internet, I'm stunned it still doesn't work:
* Upgraded the ntwdblib.dll file that PHP uses to 8.0.194, the latest
version
* Configured php.ini such that mssql.secure_connection = On [was Off
for awhile]
* Telnet-ed into the SQL server...telnet [servername].case.edu 1433'
produces a positive response.
* Confirmed a zillion times that the MSSQL extension is functional.

Any ideas? If I don't fix this, I have to learn ASP in 24 hours.

Thanks.
I highly suggest using the packaged ODBC functions instead. I use
MSSQL 05/Server2003/IIS6, mssql_* never worked for me but using ODBC
is flawless. Hope this helps!

Apr 24 '07 #6
On Apr 24, 5:57 am, spamgu...@gmail.com wrote:
I have a server with Windows 2000, PHP 5, IIS and SQL Server 2000
running. Individually, each works great. When trying to bring PHP and
MSSQL together, though, I'm tearing my hair out...it just will not
connect. Not even an error message.

Consider the code:

<?php
$server = "localhost"; // have also tried "[servername]", "localhost:
1433" and "[servername]:1433"
$username = "administrator"; // Windows username
$password = "[password]";
if (!mssql_connect($server, $username, $password))
echo "Could not connect.<p>";
?>

When thinking about all the things I've tried based on the wisdom of
the Internet, I'm stunned it still doesn't work:
* Upgraded the ntwdblib.dll file that PHP uses to 8.0.194, the latest
version
* Configured php.ini such that mssql.secure_connection = On [was Off
for awhile]
* Telnet-ed into the SQL server...telnet [servername].case.edu 1433'
produces a positive response.
* Confirmed a zillion times that the MSSQL extension is functional.

Any ideas? If I don't fix this, I have to learn ASP in 24 hours.

Thanks.
Is SQL Authentication turned on on the server? If you set
mssql.secure_connection to true, then Windows domain authentication is
used. The username and password passed to mssql_connect() will be
ignored. Unless the user that IIS runs as has access to the database,
it's not going to work.

Apr 25 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jerome Lefebvre | last post by:
Hello, Hope this will interest a few. I been working with a friend on the problems given out during the "International Collegiate Programming Contest" (ICPC) http://icpc.baylor.edu/icpc/ ....
14
by: Jim Hubbard | last post by:
Are you up to speed on the difficulties in using the 1.1 .Net framework? Not if you are unaware of the 1,596 issues listed at KBAlertz (http://www.kbalertz.com/technology_3.aspx). If you are...
1
by: 3f | last post by:
Hello; We have made a web application that people can download from our web site and installed on: Windows XP Windows 2000 Professional Windows 2003 Server Windows 2000 Server
5
by: Corky | last post by:
This works: db2 SELECT DISTINCT PROBLEM_OBJECTS.PROBLEM_ID FROM PROBLEM_OBJECTS INNER JOIN PROBLEMS ON PROBLEM_OBJECTS.PROBLEM_ID = PROBLEMS.PROBLEM_ID WHERE INTEGER(DAYS(CURRENT DATE) -...
2
by: Ellen Graves | last post by:
I am having a lot of problems with DB2 8.3.1 on RH Linux AS2.1. Installing and running stored procedures is problematic. Stored procedures I have used for years on V7 on WinNT are now failing...
19
by: Jim | last post by:
I have spent the past few weeks designing a database for my company. The problem is I have started running into what I believe are stack overflow problems. There are two tab controls on the form...
10
by: BBFrost | last post by:
We just recently moved one of our major c# apps from VS Net 2002 to VS Net 2003. At first things were looking ok, now problems are starting to appear. So far ... (1) ...
19
by: Dales | last post by:
I have a custom control that builds what we refer to as "Formlets" around some content in a page. These are basically content "wrapper" sections that are tables that have a colored header and...
2
by: Brian | last post by:
NOTE ALSO POSTED IN microsoft.public.dotnet.framework.aspnet.buildingcontrols I have solved most of my Server Control Collection property issues. I wrote an HTML page that describes all of the...
0
by: Sergistm | last post by:
Hello World, :D I have a problem that it is making me crazy, I hope you can help me. I'm trying to execute a .exe file with the Procces.Start, and there is no problem when the file is on my...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.