The OpenNET Project / Index page

[ новости /+++ | форум | теги | ]




Версия для распечатки Пред. тема | След. тема
Новые ответы [ Отслеживать ]
php70 как подключить к mssql-серверу, !*! cr1m, 20-Сен-17, 15:53  [смотреть все]
Здравствуйте, поставил 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


  • php70 как подключить к mssql-серверу, !*! cr1m, 20:11 , 20-Сен-17 (1) –1
    НАстроил 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.0

    freetds.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

    Есть тут спецы по этому вопросу?




Партнёры:
PostgresPro
Inferno Solutions
Hosting by Hoster.ru
Хостинг:

Закладки на сайте
Проследить за страницей
Created 1996-2024 by Maxim Chirkov
Добавить, Поддержать, Вебмастеру