note 81298 deleted from ref.mssql by cmb
| From: | cmb@php.net | Date: | Sun, 28 Apr 2019 09:37:11 +0000 |
| Subject: | note 81298 deleted from ref.mssql by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-210687@lists.php.net to get a copy of this message | ||
Note Submitter: Slartibartfast
----
Using Apache on a windows machine to connect to a networked SQL Server I was getting the following
error:
Warning: mssql_connect() [function.mssql-connect]: message: Login failed for user
'DomainName\MachineName$'. (severity 14)
This occurred regardless of the username and the password that I passed to mssql_connect()
Apparently the username and password parameters are ignored when connecting to SQL Server with
trusted connections. Instead it attempts to connect using the Web Server username and password
instead. Under windows the default webserver account is the machine name (which is probably not set
up as being a windows user).
This can be solved by configuring Apache to log on as a designated user.
- Open Control Panels
- Double click administrative tools
- Double click services
- Right click on Apache and choose properties
- Under the "Log On" tab choose "This Account" and type in a valid domain user
account & password
- Restart the Apache service