note 76141 deleted from function.mssql-connect by cmb
| From: | cmb@php.net | Date: | Sun, 11 Aug 2019 12:51:43 +0000 |
| Subject: | note 76141 deleted from function.mssql-connect by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-211869@lists.php.net to get a copy of this message | ||
Note Submitter: Anders Simonsen
----
Finally, I made it work... Using Windows 2003, ISS 6.0, PHP5-CGI and SQL express
It's a good idea to set your environment variables to path=%path%;c:\php and phprc=c:\php
first.
1. Fire up SQL Server Configuration Manager
2. Drill down to "Protocols for SQLEXPRESS"
3. Enable Named Pipes (God knows why)
4. Enable TCP, I have everything enabled in the "IP Addresses" tab
5. Restart SQL Express (Or the computer ;)
6. Start SQL Browser service. Remember to set it to automatic.
The final detail is the need to use (host)\SQLEXPRESS in the connection string. This is a little
problematic when using MDB2, but it works if you break the connection string into an array like
this:
$dsn = array(
'phptype' => 'mssql',
'username' => 'user',
'password' => 'yourpass',
'hostspec' => 'localhost\SQLEXPRESS',
'database' => 'yourdb',
);
require_once 'MDB2.php'; $mdb2 =& MDB2::connect($dsn);
if (PEAR::isError($mdb2)) {
echo $mdb2->getUserinfo();
}
Of course, youâll also need extension=php_mssql.dll in the PHP.ini and that ntwdblib.dll
2000.80.194.0 file mentioned bellow.
Have fun