note 94175 added to ref.pdo-dblib
| From: | twilson at tridiumtech dot com | Date: | Wed, 21 Oct 2009 01:05:43 +0000 |
| Subject: | note 94175 added to ref.pdo-dblib | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-161929@lists.php.net to get a copy of this message | ||
Hopefully this will help someone who is having problems connecting to MSSQL. I was having a heck of
a time trying to get my dev server to connect to a remote MSSQL 2005 box.
When using PDO like so:
<?php
$mssql = new
PDO('dblib:host=<host>;dbname=<dbname>','<user>','<password>');
?>
I was receiving the message:
Adaptive Server is unavailable or does not exist
And mssql_connect() simply told me "Could not connect to server"
I tried everything, different configuration options for FreeTDS/PHP, different versions, etc. But
the answer was one line in php.ini:
mssql.secure_connection = Off
This line, which defaults to Off, needs to be ON if you are using NT authentication:
mssql.secure_connection = On
Here is my build:
FreeTDS-0.82 configured like:
./configure --with-tdsver=8.0 --enable-msdblib --with-gnu-ld
PHP 5.2.11 configured like:
./configure --with-mssql=/usr/local --with-pdo-dblib=/usr/local [other options]
Running on Apache/2.2.13 (Unix / Linux)
Feel free to email me if you need help as I've spent 20+ hours reading and fiddling with this
issue, so I'm very familiar with it now.
Peace,
Tom
----
Server IP: 69.147.83.197
Probable Submitter: 72.187.35.181
----
Manual Page -- http://www.php.net/manual/en/ref.pdo-dblib.php
Edit -- https://master.php.net/note/edit/94175
Del: integrated -- https://master.php.net/note/delete/94175/integrated
Del: useless -- https://master.php.net/note/delete/94175/useless
Del: bad code -- https://master.php.net/note/delete/94175/bad+code
Del: spam -- https://master.php.net/note/delete/94175/spam
Del: non-english -- https://master.php.net/note/delete/94175/non-english
Del: in docs -- https://master.php.net/note/delete/94175/in+docs
Del: other reasons-- https://master.php.net/note/delete/94175
Reject -- https://master.php.net/note/reject/94175
Search -- https://master.php.net/manage/user-notes.php