PHP Access SQL Server settings under Linux

Source: Internet
Author: User
Tags mssql

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

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.