note 81598 deleted from ref.mssql by nlopess
| From: | nlopess@php.net | Date: | Wed, 05 Mar 2008 19:53:19 +0000 |
| Subject: | note 81598 deleted from ref.mssql by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-136773@lists.php.net to get a copy of this message | ||
Note Submitter: Sander Wartenberg
----
Running on the following settings I couldn't connect to my local SQL server.
- Apache 2.2.6
- PHP 5.2.5
- SQL Server 2005
- Windows XP SP2
The problem lies within the wrong dynamic library that is included in Apache and PHP. To fix this
problem follow this steps:
1. Download the good version of ntwdblib.dll (2000.80.194.0) http://webzila.com/dll/1/ntwdblib.zip
2. Overwrite C:\wamp\bin\apache\apache2.2.6\bin\ntwdblib.dll
3. Overwrite C:\wamp\bin\php\php5.2.5\ntwdblib.dll
4. Start the SQL Server Configuration Manager -> Protocols
5. Enable "named pipes" and "tcp/ip"
6. Right-click "tcp/ip" -> Properties tab "IP addresses"
7. Fill in "TCP Dynamic Ports" with 1433
8. Restart SQL Server AND Apache, PHP and all the other services
Try the following mssql_connect:
mssql_connect('localhost,1433', USERNAME, PASSWORD);
Good luck!