Linux connects to the SQL Server database and configures Laravel to connect

Source: Internet
Author: User

First, install FreeTDS 1, install the compiler tools and drivers

Yum install make apr* autoconf automake gcc gcc-c++ wget

2. Install UNIXODBC Driver

Yum-y Install UnixODBC Unixodbc-devel

3, installation FreeTDS

Cd/usr/local/src

wget ftp://ftp.freetds.org/pub/freetds/stable/freetds-stable.tgz #下载, sometimes can not download with wget command

Gunzip freetds-stable.tgz #解压

TAR-XVF Freetds-stable.tar

CD freetds-0.91

./configure--prefix=/usr/local/freetds--with-tdsver=8.0--with-unixodbc=/usr--enable-msdblib #配置

Make #编译

Make install #安装

4, Configuration FreeTDS

Cp/usr/local/freetds/etc/freetds.conf/usr/local/freetds/etc/freetds.confbak #备份原有文件

Vi/usr/local/freetds/etc/freetds.conf #在最后位置修改编辑以下内容

    

TDS Version = 8.0 #8.0 for the database version of SQL Server, Here I change to 11.0 there is a problem, all do not change, using the default, I use 7.0 no problem

Second, test FreeTDS

/usr/local/freetds/bin/tsql-s 192.168.0.242-u hft_test #测试, Prompt for database password

Install the MSSQL extension into the installation package of MSSQL---phpize----/configure--with-php-config=/usr/local/php5/bin/php-config--WITH-MSS Ql=/usr/local/freetds

Iv. Laravel Framework requires installation of pdo_dblib.so

Go to Dblib--phpize in the installation package--/configure--with-php-config=/usr/local/php-5.4.12/bin/php-config-- With-pdo-dblib=/usr/local/freetds Five, Leravel frame configuration

Linux connects to the SQL Server database and configures Laravel to connect

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.