|
Posted by sgottenyc on 04/04/07 23:40
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
[Back to original message]
|