Installing Freeids
Official website: wget ftp://ftp.freetds.org/pub/freetds/stable/freetds-1.00.18.tar.gz
1.1, to download the directory decompression tar xvf freetds-1.00.18.tar.gz
1.2, CD freetds-1.00.18 (i currently download the version is 1.00.18)
1.3, compile:./configure--prefix=/export/servers/freetds-1.00.18--with-tdsver=7.1--enable-msdblib
Main parameter Description:--with-tdsver set the version of FreeTDS, I set up here 7.1 is to be able to connect SQL2005
--enable-msdblib is whether to allow the Microsoft Database function library, here is allowed;
1.4, Make-j 4 (can also be directly made),-j 4 simultaneously with 4 threads to compile
1.5. Make install Installation
2. After installation, test:
2.1, cd/export/servers/freetds-1.00.18/
2.2,./tsql-c
2.3, if the installation is successful, the display:
2.mssql Extension Open
I've installed my own MSSQL in PHP, and I have mssql.so in the modules file.
You only need to add extension=mssql.so to the last line in php.ini;
If you do not have your own MSSQL, you can install it independently:
Download the source package according to the current PHP version, assuming the current is php-5.5.14
3.1, decompression php-5.3.17.tar.gz source package.
3.2. Enter the ext/mssql/(/export/software/php-5.5.14/ext/mssql/)
3.3, the implementation of/export/servers/php-5.5.14/bin/phpize
3.4./configure--with-php-config=/export/servers/php-5.5.14/bin/php-config--with-mssql=/export/servers/ freetds-1.0018/
3.5, Make-j 4 (can also be directly made),-j 4 simultaneously with 4 threads to compile
3.6. Make install
3.7. Extract mssql.so copy into/usr/local/php/lib/php/extensions/in the Generate module directory (ls/export/servers/php-5.5.14/lib/php/ extensions/no-debug-non-zts-20121212/)
3.8. Configure extension_dir= '/usr/local/php/lib/php/extensions/' in php.ini
3.9, add a line extension=mssql.so;
3.10. Restart the server
PHP Access SQL Server settings under Linux