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

    评论

报告相同问题?

悬赏问题

  • ¥35 引用csv数据文件(4列1800行),通过高斯-赛德尔法拟合曲线,在选取(每五十点取1点)数据,求该数据点的曲率中心。
  • ¥20 程序只发送0X01,串口助手显示不正确,配置看了没有问题115200-8-1-no,如何解决?
  • ¥15 Google speech command 数据集获取
  • ¥15 vue3+element-plus页面崩溃
  • ¥15 像这种代码要怎么跑起来?
  • ¥15 安卓C读取/dev/fastpipe屏幕像素数据
  • ¥15 pyqt5tools安装失败
  • ¥15 mmdetection
  • ¥15 nginx代理报502的错误
  • ¥100 当AWR1843发送完设置的固定帧后,如何使其再发送第一次的帧