Connecting Tech Pros Worldwide Help | Site Map

PHP, Apache, SQL Server 2005 Express - on Vista

sgottenyc@yahoo.com
Guest
 
Posts: n/a
#1: Apr 5 '07
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

mickysoft.org@gmail.com
Guest
 
Posts: n/a
#2: Apr 5 '07

re: PHP, Apache, SQL Server 2005 Express - on Vista


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.

Toby A Inkster
Guest
 
Posts: n/a
#3: Apr 5 '07

re: PHP, Apache, SQL Server 2005 Express - on Vista


sgottenyc wrote:
Quote:
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.
Quote:
-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!
sgottenyc@yahoo.com
Guest
 
Posts: n/a
#4: Apr 5 '07

re: PHP, Apache, SQL Server 2005 Express - on Vista


On Apr 5, 4:20 am, Toby A Inkster <usenet200...@tobyinkster.co.uk>
wrote:
Quote:
sgottenyc wrote:
Quote:
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.
>
Quote:
-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

Closed Thread