Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install mssql Module in php under linux

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "how to install mssql module in php under linux". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to install mssql module in php under linux".

1. Install and configure freetds

The copy code is as follows:

Wget http://mirrors.xmu.edu.cn/ubuntu/archive/pool/main/f/freetds/freetds_0.82.orig.tar.gz

Tar zxf freetds_0.82.orig.tar.gz

Cd freetds_0.82

/ configure-- prefix=/usr/local/freetds-- with-tdsver=8.0-- enable-msdblib-- enable-dbmfix-- with-gnu-ld-- enable-shared-- enable-static

Make & & make install

2. Compile the mssql module of php

The copy code is as follows:

Cd / path/to/php/source enters the php source directory

Cd ext/mssql enters the mssql module source directory

/ usr/local/webserver/php/bin/phpize generates a compiled configuration file

. / configure-with-php-config=/usr/local/webserver/php/bin/php-config-with-mssql=/usr/local/freetds

Make

Make install

Compile and generate mssql.so, modify php.ini, and load the module:

Extension= "/ path/to/extension/mssql.so"

3. Configure mssql

The copy code is as follows:

Cd / usr/local/freetds/etc

Edit the file:

Vi freetds.conf

[global]

# tds protocol version

; tds version = 4.2

# whether to write a tdsdump file for diagnostic purposes

# (setting this to / tmp is insecure on a multi-user system)

; dump file = / tmp/freetds.log

; debug flags = 0xffff

# command and connection timeouts

; timeout = 10

; connect timeout = 10

# if you get out-of-memory errors, it may mean that your client

# is trying to allocate a huge buffer for a text field.

# try setting 'text size' to a more reasonable limit

Text size = 64512

Client charset = utf-8 # join

# join

[server2005]

Host = 192.168.x.x

Port = 1433

Tds version = 7.2

4. Test php connection to mssql

The copy code is as follows:

Thank you for reading, the above is the content of "how to install mssql module in php under linux". After the study of this article, I believe you have a deeper understanding of how to install mssql module in php under linux, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report