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.
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
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/
# 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
3. Compile the mssql module
# Unzip the php source code package
[root@VM_0_11_centos ~]# tar zxvf php-5.2.17.tar.gz
# Enter the mssql extension directory
[root@VM_0_11_centos ~]# cd php-5.2.17/ext/mssql/
# Generate configure
[root@VM_0_11_centos mssql]# /www/server/php/52/bin/phpize
# 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
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 # 新增行
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!

php把负数转为正整数的方法:1、使用abs()函数将负数转为正数,使用intval()函数对正数取整,转为正整数,语法“intval(abs($number))”;2、利用“~”位运算符将负数取反加一,语法“~$number + 1”。

php连接mssql数据库的方法有使用PHP的MSSQL扩展、使用PDO等。详细介绍:1、使用PHP的MSSQL扩展方法,确保PHP安装了MSSQL扩展。可以在PHP配置文件(php.ini)中检查是否启用了mssql扩展;2、使用PDO方法,确保PHP安装了PDO扩展。可以在PHP配置文件(php.ini)中检查是否启用了pdo_sqlsrv扩展。

实现方法:1、使用“sleep(延迟秒数)”语句,可延迟执行函数若干秒;2、使用“time_nanosleep(延迟秒数,延迟纳秒数)”语句,可延迟执行函数若干秒和纳秒;3、使用“time_sleep_until(time()+7)”语句。

Ubuntu是一款流行的开源操作系统,常用于服务器运行。在Ubuntu上安装PHP并配置MSSQL连接是许多开发者和系统管理员经常需要做的操作之一。本文将为读者提供一份详细的指南,步骤包含安装PHP、设置Apache、安装MSSQLServer等内容,并附上具体的代码示例。第一步:安装PHP及相关扩展首先,我们需要安装PHP及其相关扩展,以便支持PHP连接

php除以100保留两位小数的方法:1、利用“/”运算符进行除法运算,语法“数值 / 100”;2、使用“number_format(除法结果, 2)”或“sprintf("%.2f",除法结果)”语句进行四舍五入的处理值,并保留两位小数。

判断方法:1、使用“strtotime("年-月-日")”语句将给定的年月日转换为时间戳格式;2、用“date("z",时间戳)+1”语句计算指定时间戳是一年的第几天。date()返回的天数是从0开始计算的,因此真实天数需要在此基础上加1。

方法:1、用“str_replace(" ","其他字符",$str)”语句,可将nbsp符替换为其他字符;2、用“preg_replace("/(\s|\ \;||\xc2\xa0)/","其他字符",$str)”语句。

php判断有没有小数点的方法:1、使用“strpos(数字字符串,'.')”语法,如果返回小数点在字符串中第一次出现的位置,则有小数点;2、使用“strrpos(数字字符串,'.')”语句,如果返回小数点在字符串中最后一次出现的位置,则有。


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 Linux new version
SublimeText3 Linux latest version

Notepad++7.3.1
Easy-to-use and free code editor

Atom editor mac version download
The most popular open source editor

WebStorm Mac version
Useful JavaScript development tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment
