美文网首页
php 5.5 + freetds

php 5.5 + freetds

作者: akka9 | 来源:发表于2017-09-23 23:29 被阅读0次

    php 5.5.38
    sql server 2008 R2 [protocol: 7.3]
    freetds 1.00.62 [support: 7.3 7.4]

    apt-get remove freetds-dev  # too old 
    wget -c ftp://ftp.freetds.org/pub/freetds/stable/freetds-patched.tar.gz
    tar zxfv freetds-patched.tar.gz
    cd freetds-*
    ./configure  --with-tdsver=7.4 --enable-msdblib
    make && make install
    
    tsql -C  # check TDS version
    TDS version: 7.4
    
    # mssql.so
    cd php-5.5.38/ext/mssql/
    /app/php/bin/phpize
    ./configure --with-php-config=/app/php/bin/php-config --with-mssql
    make && make install
    
    # pdo_dblib.so
    cd ../pdo_dblib/
    /app/php/bin/phpize
    ./configure --with-php-config=/app/php/bin/php-config --with-pdo-dblib
    make && make install
    
    
    # add php.ini
    extension = "mssql.so"  
    extension ="pdo_dblib.so"  
    
    # php code 
    $msdb=mssql_connect("ip:port","user","pass");  
    
    

    http://www.freetds.org/userguide/choosingtdsprotocol.htm
    http://chenxy.blog.51cto.com/729966/1705040

    相关文章

      网友评论

          本文标题:php 5.5 + freetds

          本文链接:https://www.haomeiwen.com/subject/cbucextx.html