douzuanze0486 2017-03-04 08:48
浏览 177

无法在Centos 7服务器上安装FreeTDS for PHP 7

We move one of our sites to a new server with Centos 7. We make the settings, the PHP 7 is working but we can't run libraries for MSSQL connection. For now we do this:

yum install freetds 
yum install php-mssql

FreeTDS appear that was installed, but: not working, in phpinfo() does not appear and in Easyapache 4 > PHP Extensions does not appear.

Thanks!

  • 写回答

1条回答 默认 最新

  • dppxp79175 2017-03-04 09:26
    关注

    1) Download FreeTDS

    wget http://ibiblio.org/pub/Linux/ALPHA/freetds/stable/freetds-stable.tgz
    

    2) Extract

    tar zfvx freetds-stable.tgz
    

    3) Configure $ Make

    cd freetds-*; ./configure --prefix=/usr/local/freetds --with-tdsver=8.0 --enable-msdblib --enable-dbmfix --with-gnu-ld; make ; make install
    

    4) Add the compile flag for freetds to /var/cpanel/easy/apache/rawopts/all_php5 In this version, PHP 5 is the focus hence that specific file. Add the following:

    echo "--with-mssql=/usr/local/freetds" >> /var/cpanel/easy/apache/rawopts/all_php5
    

    5) Touch the following files as these are what are checked for by PHP. The following error will result if they are not in place. configure: error: Directory /usr/local/freetds is not a FreeTDS installation directory. Here are the files to create for PHP's conditional check:

    touch /usr/local/freetds/lib/libtds.a
    touch /usr/local/freetds/include/tds.h
    

    6) Now run Easy Apache and make sure that Mysql, Mysql of the system, amd Mysqli are all selected.

    7) Simply build.

    /scripts/easyapache
    

    I found this - all above - here:

    https://forums.cpanel.net/threads/definitive-freetds-installation-instructions.88561/

    http://pointbeing.net/weblog/2010/05/successful-microsoft-sql-server-support-for-php-on-linux.html

    评论

报告相同问题?

悬赏问题

  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试
  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊