How to add php mssql extension

藏色散人
Release: 2023-03-15 07:32:01
Original
2628 people have browsed it

Methods to add php mssql extension: 1. Download freetds and php source code package; 2. Install freetds; 3. Unzip the php source code package and enter the mssql extension directory; 4. Generate configure; 5. Edit php. ini file, just add the mssql extension.

How to add php mssql extension

The operating environment of this article: linux5.9.8 system, php-5.2.17 version, DELL G3 computer

How to add php mssql Extension?

php install mssql extension

About the with-tdsver parameter when compiling freetds

After FreeTDS version 1.1, it can be set to auto. The version needs to be specified manually before.

I have written about mssql module installation before. This time I just added the with-tdsver parameter when compiling freetds.

1. Download freetds and php source code package

[root@VM_0_11_centos ~]# wget -c ftp://ftp.freetds.org/pub/freetds/stable/freetds-1.1.21.tar.gz [root@VM_0_11_centos ~]# wget -c http://museum.php.net/php5/php-5.2.17.tar.gz
Copy after login

2. Install freetds

# Unzip the freetds source code package

[root@VM_0_11_centos ~]# tar zxvf freetds-1.1.21.tar.gz [root@VM_0_11_centos ~]# cd freetds-1.1.21/
Copy after login

# Start compilation and installation

[root@VM_0_11_centos ~]# ./configure --prefix=/usr/local/freetds --with-tdsver=7.3 --enable-msdblib [root@VM_0_11_centos ~]# make && make install
Copy after login

3. Compile the mssql module

# Unzip the php source code package

[root@VM_0_11_centos ~]# tar zxvf php-5.2.17.tar.gz
Copy after login

# Enter the mssql extension directory

[root@VM_0_11_centos ~]# cd php-5.2.17/ext/mssql/
Copy after login

# Generate configure

[root@VM_0_11_centos mssql]# /www/server/php/52/bin/phpize
Copy after login

# Start compiling

[root@VM_0_11_centos php-5.2.17]# ./configure --with-php-config=/www/server/php/52/bin/php-config --with-mssql=/usr/local/freetds [root@VM_0_11_centos php-5.2.17]# make && make install
Copy after login

4. Edit the php.ini file and add the mssql extension under line 491 Add (if you don’t know how to use the vi editor, you can directly download and modify the file and then upload it)

[root@VM_0_11_centos ~]# vi /www/server/php/52/etc/php.ini extension_dir = "/www/server/php/52/lib/php/extensions/no-debug-non-zts-20060613/" extension = mssql.so # 新增行
Copy after login

Save and exit, restart php or restart the server.

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of How to add php mssql extension. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!