473,406 Members | 2,867 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,406 software developers and data experts.

PHP, Apache, SQL Server 2005 Express - on Vista

Hello,
Has anyone had any success running SQL Server Express on Vista with
Apache via PHP?
My PHP works fine, Apache works fine, and SQL Server Express works
fine in Management Studio, but I cannot connect via this call:

$myServer = "servername";
$myUser = "username";
$myPass = "password";
$myDB = "myDB";

$conn = mssql_connect($myServer, $myUser, $myPass)
or die("Couldn't connect to Server.");

mssql_select_db($myDB, $conn)
or die("Couldn't connect to Server database.");

The error is "Couldn't connect to Server", so the first connection
statement fails.

The code works fine on a Windows XP machine with Apache as well as a
Windows Server 2003 running IIS, so I don't think that's the problem.
My Apache and PHP work fine on the Vista machine, since phpinfo()
outputs correctly. SQL Server Express works fine by itself as well -
it is the latest version of the software, downloaded quite recently,
so it works fine with Vista.
I have tried the following:
-Enabled TCP/IP, Named Pipes, VIA, and Shared Memory in SQL Server
Configuration Manager.
-Added my Windows account to the administrators in SQL Server Surface
Area Configuration.
-Tried "servername\sqlexpress" and just "sqlexpress", instead of
"servername", in the above connection string.
-Tried turning on mssql.secure_connection in php.ini and then
connecting to port 1443.
-Tried placing php.ini in C:\windows and php_mssql.dll in C:\windows
\system32.
-I searched google for solutions. In addition to the above, one
suggestion was made that a file called ntwdblib.dll needs to be
upgraded. I believe this is an IIS specific file since I don't have
it on my system, so it shouldn't apply in my case.
Any ideas?
Suggestions in addition to the above are very much appreciated.
Thanks in advance,
Simon Gottesman

Apr 4 '07 #1
3 7949
hey, have you tried disabling the firewall and any security related to
this service? just asking since vista has it`s own ideas about what
should run and not and usually doesn`t ask you about it.

Apr 5 '07 #2
sgottenyc wrote:
Has anyone had any success running SQL Server Express on Vista with
Apache via PHP?
No, but I've done this on Linux. The code you posted looks fine. Turn on
all error reporting at the top of your file:

ini_set('display_errors', TRUE);
error_reporting(E_ALL);

and see what error messages you get. It's likely to be a problem with your
setup, not the code.
-I searched google for solutions. In addition to the above, one
suggestion was made that a file called ntwdblib.dll needs to be
upgraded. I believe this is an IIS specific file since I don't have
it on my system, so it shouldn't apply in my case.
You definitely need this file. See the "Requirements" section on this
page:
http://uk.php.net/manual/en/ref.mssql.php

I don't think SQL Server Express includes this file, but it does come with
SQL Server 2000. It's probably also in SQL Server 2000 SP4, but that's
quite a big download. Ooh look... it seems someone's uploaded that file
here:

http://www.gigasize.com/get.php/1106430/ntwdblib.dll

I wonder who that was.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!
Apr 5 '07 #3
On Apr 5, 4:20 am, Toby A Inkster <usenet200...@tobyinkster.co.uk>
wrote:
sgottenyc wrote:
Has anyone had any success running SQL Server Express on Vista with
Apache via PHP?

No, but I've done this on Linux. The code you posted looks fine. Turn on
all error reporting at the top of your file:

ini_set('display_errors', TRUE);
error_reporting(E_ALL);

and see what error messages you get. It's likely to be a problem with your
setup, not the code.
-I searched google for solutions. In addition to the above, one
suggestion was made that a file called ntwdblib.dll needs to be
upgraded. I believe this is an IIS specific file since I don't have
it on my system, so it shouldn't apply in my case.

You definitely need this file. See the "Requirements" section on this
page:
http://uk.php.net/manual/en/ref.mssql.php

I don't think SQL Server Express includes this file, but it does come with
SQL Server 2000. It's probably also in SQL Server 2000 SP4, but that's
quite a big download. Ooh look... it seems someone's uploaded that file
here:

http://www.gigasize.com/get.php/1106430/ntwdblib.dll

I wonder who that was.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!
Thanks Toby,
That did it - placing the downloaded ntwdblib.dll in C:\php and C:
\winnt\system32 did the trick!
(And here I was starting to consider downgrading to Windows XP
instead.)
Thanks again and take care,
Simon

Apr 5 '07 #4

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

Similar topics

4
by: Patrick Masson | last post by:
Hello, Our configuration : Apache 2.0.53 PHP 5.0.4 PC Windows 2000 MATLAB 6.1 We work on a consulting project in France which involves MATLAB Web server,
1
by: Peter | last post by:
I've purchased VS.NET 2005 Standard and have tried to install SQL Server 2005 Express, but get the following error in the error log. Please could someone help me.... Microsoft SQL Server 2005...
2
by: kress1963nov22 | last post by:
I recently purchased a good MS book ("Build a Web Site Now") by Jim Buyens. It has the Express Edition of MS-Visual Web Developer 2005 on CD and also MS SQL Server 2005 Express Edition on the CD. A...
3
by: ianforgroupuse | last post by:
I'm running Vista Business edition on 2005 Virtual PC. Installed SQL Server 2005 Express latest download, with instance of MSSQLSERVER and service accounts running under "NT AUTHORITY\SYSTEM"....
4
by: Wolfgang Kraus | last post by:
Hi, i want to create a solution which shall consist of a sql server 2005 - data base (express edition if the following features are available by express edition) and a mobile windows application...
4
by: Preben Zacho | last post by:
Hi there The scenario I got is this: I have created a Windows application in VS and I want to deploy it to another machine running Windows Vista. Since I have no control over this other machine,...
0
by: sebor | last post by:
October 29, 2007 -- The Apache C++ Standard Library project is pleased to announce that the official stdcxx 4.2.0 release is now available for download from the following location:...
2
by: egress | last post by:
I've created an SQL Server Express database with one table that I use in my test envionement (Windows Vista). I'm developing an ASP.NET web app with VS 2005 and try to connect to the express...
7
by: Joe | last post by:
I added some ajax to my asp.net web site and will Ajax just doesn't seem to work. Does Any one PLEASE have any ideas on why Ajax doesn't work on Apache 2.2.6 w/asp.net 2.0
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.