RE: Connect to MSDE using PHP
| From: | Colin Williams | Date: | Mon, 23 Feb 2004 14:37:18 +0000 |
| Subject: | RE: Connect to MSDE using PHP | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-33071@lists.php.net to get a copy of this message | ||
It might be worth running netstat on the server to check if SQL Server
is listening on a TCP port. If not, check the config. I think the full
version of SQL Server defaults to using named pipes only, TCP has to be
explicitly enabled.
My textbook also says that SQL Server runs under the 'Local System'
account, which might not have permission to access the network. The
textbook recommends creating a new account with local administrator
rights to run the service (this is for the full version of SQL Server,
the desktop edition is probably the same). I don't know if this is wise
or not, my Windows expertise falls far short of understanding all the
different privilege levels.
Colin.
-----Original Message-----
From: John W. Holmes [mailto:holmes072000@charter.net]
Sent: 22 February 2004 15:57
To: php-db@lists.php.net
Subject: Connect to MSDE using PHP
I've downlownded and installed the Desktop Edition of MSSQL and am
trying to connect to it with PHP. Has anyone ever accomplished this?
I've uncommented the line in php.ini to load the MSSQL functions and
they show up on a phpinfo() page, so that part is good.
When I installed MSDE I tried it without a named instance first and just
set an SA password.
Neither of these worked:
mssql_connect('localhost','sa','password')
mssql_connect('coconut','sa','password')
where "coconut" is the name of my computer.
Then I tried installing MSDE again with a named instance and tried
mssql_connect('namedinstance\localhost','sa','password')
mssql_connect('namedinstance\coconut','sa','password')
and those wouldn't work either. The only response I get is "failed to
connect to server ..."
I'm off to try ODBC. Anyone have any suggestions?
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals - www.phparch.com