I\'m connecting to external MSSQL database for exports from PHP55/osx and I have wierd issue.
code:
new \\PDO(\"dblib:host={$hostnam
My solution:
Get FreeTds
brew install freetds
Compile and install the dblib extension
ext/pdo_dblib
subfolder of the sourcephpize
, making sure it is the correct binary for your installation./configure --with-php-config=/usr/local/php5/bin/php-config --with-pdo-dblib=/usr/local/Cellar/freetds/0.95.19/
make
modules/pdo_dblib.so
into your PHP installation directory, replacing the old versionCheck these:
locate freetds.conf on your disk. It is possible it exists in several places and tsql uses one while PHP used another one. Best is to symlink them into one common file and test on that. Note that a common place for that file is ~/.freetds.conf beside /etc/ or /usr/local/etc/
there should be a [global] section on your freetds.conf file. Put there these lines :
tds version = 8.0
text size = 20971520
client charset = UTF-8
Of course, I expect that you already checked which driver is loaded by PHP with phpinfo(): mssql, sqlsrv or dblib