Здравствуйте, поставил php70 (freebsd 10.3) (в старых версиях был в портах php53-mssql, теперь нет), freetds:
tsql -C
Compile-time settings (established with the "configure" script)
Version: freetds v1.00.59
freetds.conf directory: /usr/local/etc/freetds
MS db-lib source compatibility: yes
Sybase binary compatibility: yes
Thread safety: yes
iconv library: yes
TDS version: 7.4
iODBC: no
unixodbc: yes
SSPI "trusted" logins: no
Kerberos: no
OpenSSL: yes
GnuTLS: no
MARS: noВ файле /usr/local/etc/freetds/freetds.conf
[w2k3new.domain.local]
host = w2k3new.domain.local
port = 1433
tds version = 8.0
client charset = cp1251При попытке из php-скрипта сделать odbc_connect пишет:
Warning: odbc_connect(): SQL error: [unixODBC][Driver Manager]Data source name not found, and no default driver specified, SQL state IM002 in SQLConnect in
Ну и модули апача:php -m
[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dba
dom
fileinfo
filter
ftp
gd
hash
iconv
imap
json
ldap
libxml
mcrypt
mysqli
mysqlnd
odbc
pcre
PDO
PDO_ODBC
pdo_sqlite
Phar
posix
Reflection
session
SimpleXML
snmp
SPL
sqlite3
standard
tokenizer
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zip
zlib[Zend Modules]
Zend OPcache
НАстроил odbc.ini, odbcinst.ini, freetds.conf, теперь такая ошибкаisql -v w2k3new.domain.local user password
[S1000][unixODBC][FreeTDS][SQL Server]Unable to connect to data source
[08S01][unixODBC][FreeTDS][SQL Server]Bad token from the server: Datastream processing out of sync
[01000][unixODBC][FreeTDS][SQL Server]Changed database context to 'IPT_SQL'.
[ISQL]ERROR: Could not SQLConnect
odbc.ini:
[w2k3new.domain.local]
Driver = FreeTDS
Description = mssql
Trace = Yes
Server = 192.168.1.173
Port = 1433
TDS version = 7.4
Database = IPT_SQL
odbcinst.ini:
[FreeTDS]
Description = FreeTDS 7.4
Driver = /usr/local/lib/libtdsodbc.so.0freetds.conf:
[global]
# TDS protocol version
tds version = auto# Whether to write a TDSDUMP file for diagnostic purposes
# (setting this to /tmp is insecure on a multi-user system)
dump file = /tmp/freetds.log
; debug flags = 0xffff# Command and connection timeouts
; timeout = 10
; connect timeout = 10# If you get out-of-memory errors, it may mean that your client
# is trying to allocate a huge buffer for a TEXT field.
# Try setting 'text size' to a more reasonable limit
text size = 64512# If you experience TLS handshake errors and are using openssl,
# try adjusting the cipher list (don't surround in double or single quotes)
# openssl ciphers = HIGH:!SSLv2:!aNULL:-DH# A typical Sybase server
[mypool]
host = 127.0.0.1
port = 5000
tds version = 5.0# A typical Microsoft server
[w2k3new.domain.local]
host = w2k3new.domain.local
port = 1433
tds version = 8.0
client charset = cp1251Есть тут спецы по этому вопросу?
> [w2k3new.domain.local]
> TDS version = 7.4
> [w2k3new.domain.local]
> tds version = 8.0определись для начала?
http://www.freetds.org/userguide/choosingtdsprotocol.htm> Есть тут спецы по этому вопросу?
"спец" бы сказал к какому эмэскулу подключается ...
>> Есть тут спецы по этому вопросу?
> "спец" бы сказал к какому эмэскулу подключается ...+
в добавок указал бы на документ http://php.net/manual/en/migration70.php :)
и потом на http://php.net/manual/en/function.mssql-connect.php с https://github.com/Microsoft/msphpsql
Снимаю вопрос, заработало, немного скорректировал конфиг odbc.