Introduction: Linux Under the configuration of PHP extension MSSQL, so that PHP through the MSSQL tool implementation and remote win SQL Server data transfer.
There are two ways of doing this:
One, the first time to compile PHP to provide MSSQL support, that is, the compilation parameters to add--with-mssql=/path
Second, for the installation of PHP, you need to take MSSQL as a module, compiled PHP to support it, this article mainly explains this method:
1. Installation Configuration FreeTDS
Download the source package and compile the installation
#wget tp://ibiblio.org/pub/linux/alpha/freetds/stable/freetds-stable.tgz
#tar-zxvf freetds-stable.tgz#cd freetds-freetds-0.91/#./configure--prefix=/usr/local/freetds--enable-msdblib# Make#make Install
2. Re-add PHP to support the MSSQL module
1) Enter the source code directory of PHP (the source code package extracted from the PHP directory)
#cd ~/php-5.5.13/ext/mssql/
2) Execute phpize generate compile config file (Phpize is used to extend PHP extension module, through phpize can build PHP plug-in module)
#/usr/local/php/bin/phpize
3) Recompile
#./configure--with-php-config=/usr/local/php/bin/php-config--with-mssql=/usr/local/freetds/#make #make Install
4) See instructions to install the module successfully and open the module in php.ini as shown in the path
650) this.width=650; "title=" Figure II "alt=" Wkiom1phbiazrxbpaabousv9zu8976.jpg "src=" http://s3.51cto.com/wyfs02/M01/44/ 58/wkiom1phbiazrxbpaabousv9zu8976.jpg "/>
3, modify the freetds.conf
#vim/usr/local/freetds/etc/freetds.conf[server2008]host = 10.32.22.100port = 1433tds Version = 7.0client charset = UTF8
3, verify (do not need to restart PHP-FPM)
#php-M | grep mssqlmssql
4. Test connection
650) this.width=650; "title=" Figure three "alt=" Wkiom1phbzdc4ghzaafz-sfpldy984.jpg "src=" http://s3.51cto.com/wyfs02/M02/44/ 58/wkiom1phbzdc4ghzaafz-sfpldy984.jpg "/>
Note: Due to version may be error, you need to use tdsver=7.0 to specify the version.
This article is from the "Linux_ ant" blog, please make sure to keep this source http://onlyoulinux.blog.51cto.com/7941460/1536188