`

linux php 连接sql server2000

阅读更多

说明:

Linux服务器系统:CentOS 5.5

Web环境:LAMP或者LNMP

Windows服务器系统:Windows Server 2003

Windows服务器IP地址:192.168.21.134

数据库环境:SQL Server 2000数据库

数据库账号:sa

数据库密码:123456

实现目的:Linux服务器中的php程序能够连接到Windows服务器中的SQL Server 2000数据库

具体步骤:

一、在Linux服务器中安装freetds

1、安装编译工具及驱动程序

yum install make apr* autoconf automake gcc gcc-c++ wget

2、安装unixODBC驱动程序

yum -y install unixODBC unixODBC-devel

3、安装freetds

cd /usr/local/src

wget ftp://ftp.freetds.org/pub/freetds/stable/freetds-stable.tgz #下载

gunzip freetds-stable.tgz #解压

tar -xvf freetds-stable.tar

cd freetds-0.91

./configure --prefix=/usr/local/freetds --with-tdsver=8.0 --with-unixodbc=/usr --enable-msdblib #配置

make #编译

make install #安装

4、配置freetds

cp /usr/local/freetds/etc/freetds.conf /usr/local/freetds/etc/freetds.confbak #备份原有文件

vi /usr/local/freetds/etc/freetds.conf #在最后位置修改编辑以下内容

系统运维 www.osyunwei.com 温馨提醒:qihang01原创内容版权所有,转载请注明出处及原文链

[192.168.21.134]
host = 192.168.21.134 #SQL Server 2000服务器地址
port = 1433 #SQL Server 2000数据库端口
tds version = 8.0 #8.0代表数据库版本为SQL Server 2000
client charset = UTF-8 #设置字符集

5、测试freetds

/usr/local/freetds/bin/tsql -S 192.168.21.134 -U sa #测试,提示输入数据库密码,出现下面界面,配置成功

cd /usr/local/freetds/bin

./tsql -S 192.168.21.134 -p 1433 -U sa -P 123456 -D master #测试,出现下面界面,配置成功

二、配置Linux php连接SQL Server 2000数据库

1、php是用yum命令在线安装

yum install php-mssql #安装php-mssql扩展,如果提示没有此安装包,请先配置第三方yum源

wget http://www.atomicorp.com/installers/atomic #下载

sh ./atomic #安装

[root@huangwei bin]# sh ./atomic
ln: "/etc/system-release" 与"/etc/fedora-release" 为同一文件

Atomic Free Unsupported Archive installer, version 2.0.12

BY INSTALLING THIS SOFTWARE AND BY USING ANY AND ALL SOFTWARE
PROVIDED BY ATOMICORP LIMITED YOU ACKNOWLEDGE AND AGREE:

THIS SOFTWARE AND ALL SOFTWARE PROVIDED IN THIS REPOSITORY IS
PROVIDED BY ATOMICORP LIMITED AS IS, IS UNSUPPORTED AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ATOMICORP LIMITED, THE
COPYRIGHT OWNER OR ANY CONTRIBUTOR TO ANY AND ALL SOFTWARE PROVIDED
BY OR PUBLISHED IN THIS REPOSITORY BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
OF THE POSSIBILITY OF SUCH DAMAGE.

====================================================================
THIS SOFTWARE IS UNSUPPORTED.  IF YOU REQUIRE SUPPORTED SOFWARE
PLEASE SEE THE URL BELOW TO PURCHASE A NUCLEUS LICENSE AND DO NOT
PROCEED WITH INSTALLING THIS PACKAGE.
====================================================================

For supported software packages please purchase a Nucleus license:
https://www.atomicorp.com/products/nucleus.html
All atomic repository rpms are UNSUPPORTED.
Do you agree to these terms? (yes/no) [Default: yes] yes

Configuring the [atomic] yum archive for this system

Installing the Atomic GPG key: OK
Downloading atomic-release-1.0-19.fc20.art.noarch.rpm:
OK



The Atomic Rocket Turtle archive has now been installed and configured for your system
The following channels are available:
  atomic          - [ACTIVATED] - contains the stable tree of ART packages
  atomic-testing  - [DISABLED]  - contains the testing tree of ART packages
  atomic-bleeding - [DISABLED]  - contains the development tree of ART packages

 

yum install php-mssql #再次执行

[root@iZ25vqhgbx2Z freetds-0.91]# yum install php-mssql
Loaded plugins: security
atomic                                                   | 3.4 kB     00:00    
atomic/primary_db                                        | 844 kB     00:10    
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php-mssql.x86_64 0:5.3.3-3.el6 will be updated
---> Package php-mssql.x86_64 0:5.4.31-37.el6.art will be an update
--> Processing Dependency: php-pdo(x86-64) = 5.4.31-37.el6.art for package: php-mssql-5.4.31-37.el6.art.x86_64
--> Running transaction check
---> Package php-pdo.x86_64 0:5.3.3-27.el6_5.1 will be updated
---> Package php-pdo.x86_64 0:5.4.31-37.el6.art will be an update
--> Processing Dependency: php-common(x86-64) = 5.4.31-37.el6.art for package: php-pdo-5.4.31-37.el6.art.x86_64
--> Running transaction check
---> Package php-common.x86_64 0:5.3.3-27.el6_5.1 will be updated
--> Processing Dependency: php(api) = 20090626 for package: php-mcrypt-5.3.3-3.el6.x86_64
--> Processing Dependency: php(zend-abi) = 20090626 for package: php-mcrypt-5.3.3-3.el6.x86_64
--> Processing Dependency: php-common(x86-64) = 5.3.3-27.el6_5.1 for package: php-gd-5.3.3-27.el6_5.1.x86_64
--> Processing Dependency: php-common(x86-64) = 5.3.3-27.el6_5.1 for package: php-cli-5.3.3-27.el6_5.1.x86_64
--> Processing Dependency: php-common(x86-64) = 5.3.3-27.el6_5.1 for package: php-mysql-5.3.3-27.el6_5.1.x86_64
--> Processing Dependency: php-common(x86-64) = 5.3.3-27.el6_5.1 for package: php-bcmath-5.3.3-27.el6_5.1.x86_64
--> Processing Dependency: php-common(x86-64) = 5.3.3-27.el6_5.1 for package: php-xml-5.3.3-27.el6_5.1.x86_64
--> Processing Dependency: php-common(x86-64) = 5.3.3-27.el6_5.1 for package: php-ldap-5.3.3-27.el6_5.1.x86_64
--> Processing Dependency: php-common(x86-64) = 5.3.3-27.el6_5.1 for package: php-odbc-5.3.3-27.el6_5.1.x86_64
--> Processing Dependency: php-common(x86-64) = 5.3.3-27.el6_5.1 for package: php-xmlrpc-5.3.3-27.el6_5.1.x86_64
--> Processing Dependency: php-common(x86-64) = 5.3.3-27.el6_5.1 for package: php-imap-5.3.3-27.el6_5.1.x86_64
--> Processing Dependency: php-common(x86-64) = 5.3.3-27.el6_5.1 for package: php-5.3.3-27.el6_5.1.x86_64
--> Processing Dependency: php-common(x86-64) = 5.3.3-27.el6_5.1 for package: php-mbstring-5.3.3-27.el6_5.1.x86_64
---> Package php-common.x86_64 0:5.4.31-37.el6.art will be an update
--> Running transaction check
---> Package php.x86_64 0:5.3.3-27.el6_5.1 will be updated
---> Package php.x86_64 0:5.4.31-37.el6.art will be an update
---> Package php-bcmath.x86_64 0:5.3.3-27.el6_5.1 will be updated
---> Package php-bcmath.x86_64 0:5.4.31-37.el6.art will be an update
---> Package php-cli.x86_64 0:5.3.3-27.el6_5.1 will be updated
---> Package php-cli.x86_64 0:5.4.31-37.el6.art will be an update
---> Package php-gd.x86_64 0:5.3.3-27.el6_5.1 will be updated
---> Package php-gd.x86_64 0:5.4.31-37.el6.art will be an update
--> Processing Dependency: libt1.so.5()(64bit) for package: php-gd-5.4.31-37.el6.art.x86_64
---> Package php-imap.x86_64 0:5.3.3-27.el6_5.1 will be updated
---> Package php-imap.x86_64 0:5.4.31-37.el6.art will be an update
---> Package php-ldap.x86_64 0:5.3.3-27.el6_5.1 will be updated
---> Package php-ldap.x86_64 0:5.4.31-37.el6.art will be an update
---> Package php-mbstring.x86_64 0:5.3.3-27.el6_5.1 will be updated
---> Package php-mbstring.x86_64 0:5.4.31-37.el6.art will be an update
---> Package php-mcrypt.x86_64 0:5.3.3-3.el6 will be updated
---> Package php-mcrypt.x86_64 0:5.4.31-37.el6.art will be an update
---> Package php-mysql.x86_64 0:5.3.3-27.el6_5.1 will be updated
---> Package php-mysql.x86_64 0:5.4.31-37.el6.art will be an update
---> Package php-odbc.x86_64 0:5.3.3-27.el6_5.1 will be updated
---> Package php-odbc.x86_64 0:5.4.31-37.el6.art will be an update
---> Package php-xml.x86_64 0:5.3.3-27.el6_5.1 will be updated
---> Package php-xml.x86_64 0:5.4.31-37.el6.art will be an update
---> Package php-xmlrpc.x86_64 0:5.3.3-27.el6_5.1 will be updated
---> Package php-xmlrpc.x86_64 0:5.4.31-37.el6.art will be an update
--> Running transaction check
---> Package t1lib.x86_64 0:5.1.2-6.el6_2.1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package             Arch          Version                  Repository     Size
================================================================================
Updating:
 php-mssql           x86_64        5.4.31-37.el6.art        atomic         66 k
Installing for dependencies:
 t1lib               x86_64        5.1.2-6.el6_2.1          base          160 k
Updating for dependencies:
 php                 x86_64        5.4.31-37.el6.art        atomic        2.7 M
 php-bcmath          x86_64        5.4.31-37.el6.art        atomic         60 k
 php-cli             x86_64        5.4.31-37.el6.art        atomic        2.6 M
 php-common          x86_64        5.4.31-37.el6.art        atomic        932 k
 php-gd              x86_64        5.4.31-37.el6.art        atomic        143 k
 php-imap            x86_64        5.4.31-37.el6.art        atomic         79 k
 php-ldap            x86_64        5.4.31-37.el6.art        atomic         62 k
 php-mbstring        x86_64        5.4.31-37.el6.art        atomic        944 k
 php-mcrypt          x86_64        5.4.31-37.el6.art        atomic         51 k
 php-mysql           x86_64        5.4.31-37.el6.art        atomic        136 k
 php-odbc            x86_64        5.4.31-37.el6.art        atomic         78 k
 php-pdo             x86_64        5.4.31-37.el6.art        atomic        120 k
 php-xml             x86_64        5.4.31-37.el6.art        atomic        171 k
 php-xmlrpc          x86_64        5.4.31-37.el6.art        atomic         70 k

Transaction Summary
================================================================================
Install       1 Package(s)
Upgrade      15 Package(s)

Total download size: 8.3 M
Is this ok [y/N]: y
Downloading Packages:
(1/16): php-5.4.31-37.el6.art.x86_64.rpm                 | 2.7 MB     00:09    
(2/16): php-bcmath-5.4.31-37.el6.art.x86_64.rpm          |  60 kB     00:00    
(3/16): php-cli-5.4.31-37.el6.art.x86_64.rpm             | 2.6 MB     00:22    
(4/16): php-common-5.4.31-37.el6.art.x86_64.rpm          | 932 kB     00:02    
(5/16): php-gd-5.4.31-37.el6.art.x86_64.rpm              | 143 kB     00:00    
(6/16): php-imap-5.4.31-37.el6.art.x86_64.rpm            |  79 kB     00:00    
(7/16): php-ldap-5.4.31-37.el6.art.x86_64.rpm            |  62 kB     00:00    
(8/16): php-mbstring-5.4.31-37.el6.art.x86_64.rpm        | 944 kB     00:02    
(9/16): php-mcrypt-5.4.31-37.el6.art.x86_64.rpm          |  51 kB     00:00    
(10/16): php-mssql-5.4.31-37.el6.art.x86_64.rpm          |  66 kB     00:00    
(11/16): php-mysql-5.4.31-37.el6.art.x86_64.rpm          | 136 kB     00:00    
(12/16): php-odbc-5.4.31-37.el6.art.x86_64.rpm           |  78 kB     00:00    
(13/16): php-pdo-5.4.31-37.el6.art.x86_64.rpm            | 120 kB     00:00    
(14/16): php-xml-5.4.31-37.el6.art.x86_64.rpm            | 171 kB     00:01    
(15/16): php-xmlrpc-5.4.31-37.el6.art.x86_64.rpm         |  70 kB     00:00    
(16/16): t1lib-5.1.2-6.el6_2.1.x86_64.rpm                | 160 kB     00:00    
--------------------------------------------------------------------------------
Total                                           166 kB/s | 8.3 MB     00:51    
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID 4520afa9: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY.art.txt
Importing GPG key 0x5EBD2744:
 Userid : Atomic Rocket Turtle <admin@atomicrocketturtle.com>
 Package: atomic-release-1.0-19.el6.art.noarch (installed)
 From   : /etc/pki/rpm-gpg/RPM-GPG-KEY.art.txt
Is this ok [y/N]: y
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY.atomicorp.txt
Importing GPG key 0x4520AFA9:
 Userid : Atomicorp (Atomicorp Official Signing Key) <support@atomicorp.com>
 Package: atomic-release-1.0-19.el6.art.noarch (installed)
 From   : /etc/pki/rpm-gpg/RPM-GPG-KEY.atomicorp.txt
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
  Updating   : php-common-5.4.31-37.el6.art.x86_64                         1/31
warning: /etc/php.ini created as /etc/php.ini.rpmnew
  Updating   : php-pdo-5.4.31-37.el6.art.x86_64                            2/31
  Updating   : php-cli-5.4.31-37.el6.art.x86_64                            3/31
  Installing : t1lib-5.1.2-6.el6_2.1.x86_64                                4/31
  Updating   : php-gd-5.4.31-37.el6.art.x86_64                             5/31
  Updating   : php-5.4.31-37.el6.art.x86_64                                6/31
  Updating   : php-mssql-5.4.31-37.el6.art.x86_64                          7/31
  Updating   : php-odbc-5.4.31-37.el6.art.x86_64                           8/31
  Updating   : php-mysql-5.4.31-37.el6.art.x86_64                          9/31
  Updating   : php-bcmath-5.4.31-37.el6.art.x86_64                        10/31
  Updating   : php-xml-5.4.31-37.el6.art.x86_64                           11/31
  Updating   : php-imap-5.4.31-37.el6.art.x86_64                          12/31
  Updating   : php-mcrypt-5.4.31-37.el6.art.x86_64                        13/31
  Updating   : php-mbstring-5.4.31-37.el6.art.x86_64                      14/31
  Updating   : php-ldap-5.4.31-37.el6.art.x86_64                          15/31
  Updating   : php-xmlrpc-5.4.31-37.el6.art.x86_64                        16/31
  Cleanup    : php-5.3.3-27.el6_5.1.x86_64                                17/31
  Cleanup    : php-mysql-5.3.3-27.el6_5.1.x86_64                          18/31
  Cleanup    : php-odbc-5.3.3-27.el6_5.1.x86_64                           19/31
  Cleanup    : php-mssql-5.3.3-3.el6.x86_64                               20/31
  Cleanup    : php-pdo-5.3.3-27.el6_5.1.x86_64                            21/31
  Cleanup    : php-cli-5.3.3-27.el6_5.1.x86_64                            22/31
  Cleanup    : php-xmlrpc-5.3.3-27.el6_5.1.x86_64                         23/31
  Cleanup    : php-ldap-5.3.3-27.el6_5.1.x86_64                           24/31
  Cleanup    : php-gd-5.3.3-27.el6_5.1.x86_64                             25/31
  Cleanup    : php-mbstring-5.3.3-27.el6_5.1.x86_64                       26/31
  Cleanup    : php-mcrypt-5.3.3-3.el6.x86_64                              27/31
  Cleanup    : php-imap-5.3.3-27.el6_5.1.x86_64                           28/31
  Cleanup    : php-xml-5.3.3-27.el6_5.1.x86_64                            29/31
  Cleanup    : php-bcmath-5.3.3-27.el6_5.1.x86_64                         30/31
  Cleanup    : php-common-5.3.3-27.el6_5.1.x86_64                         31/31
  Verifying  : php-bcmath-5.4.31-37.el6.art.x86_64                         1/31
  Verifying  : php-mssql-5.4.31-37.el6.art.x86_64                          2/31
  Verifying  : php-xml-5.4.31-37.el6.art.x86_64                            3/31
  Verifying  : php-imap-5.4.31-37.el6.art.x86_64                           4/31
  Verifying  : php-cli-5.4.31-37.el6.art.x86_64                            5/31
  Verifying  : php-mcrypt-5.4.31-37.el6.art.x86_64                         6/31
  Verifying  : php-odbc-5.4.31-37.el6.art.x86_64                           7/31
  Verifying  : php-mbstring-5.4.31-37.el6.art.x86_64                       8/31
  Verifying  : php-pdo-5.4.31-37.el6.art.x86_64                            9/31
  Verifying  : php-mysql-5.4.31-37.el6.art.x86_64                         10/31
  Verifying  : php-gd-5.4.31-37.el6.art.x86_64                            11/31
  Verifying  : php-ldap-5.4.31-37.el6.art.x86_64                          12/31
  Verifying  : t1lib-5.1.2-6.el6_2.1.x86_64                               13/31
  Verifying  : php-common-5.4.31-37.el6.art.x86_64                        14/31
  Verifying  : php-xmlrpc-5.4.31-37.el6.art.x86_64                        15/31
  Verifying  : php-5.4.31-37.el6.art.x86_64                               16/31
  Verifying  : php-pdo-5.3.3-27.el6_5.1.x86_64                            17/31
  Verifying  : php-5.3.3-27.el6_5.1.x86_64                                18/31
  Verifying  : php-mbstring-5.3.3-27.el6_5.1.x86_64                       19/31
  Verifying  : php-odbc-5.3.3-27.el6_5.1.x86_64                           20/31
  Verifying  : php-bcmath-5.3.3-27.el6_5.1.x86_64                         21/31
  Verifying  : php-imap-5.3.3-27.el6_5.1.x86_64                           22/31
  Verifying  : php-mssql-5.3.3-3.el6.x86_64                               23/31
  Verifying  : php-xmlrpc-5.3.3-27.el6_5.1.x86_64                         24/31
  Verifying  : php-common-5.3.3-27.el6_5.1.x86_64                         25/31
  Verifying  : php-cli-5.3.3-27.el6_5.1.x86_64                            26/31
  Verifying  : php-gd-5.3.3-27.el6_5.1.x86_64                             27/31
  Verifying  : php-mysql-5.3.3-27.el6_5.1.x86_64                          28/31
  Verifying  : php-mcrypt-5.3.3-3.el6.x86_64                              29/31
  Verifying  : php-xml-5.3.3-27.el6_5.1.x86_64                            30/31
  Verifying  : php-ldap-5.3.3-27.el6_5.1.x86_64                           31/31

Dependency Installed:
  t1lib.x86_64 0:5.1.2-6.el6_2.1                                               

Updated:
  php-mssql.x86_64 0:5.4.31-37.el6.art                                         

Dependency Updated:
  php.x86_64 0:5.4.31-37.el6.art        php-bcmath.x86_64 0:5.4.31-37.el6.art 
  php-cli.x86_64 0:5.4.31-37.el6.art    php-common.x86_64 0:5.4.31-37.el6.art 
  php-gd.x86_64 0:5.4.31-37.el6.art     php-imap.x86_64 0:5.4.31-37.el6.art   
  php-ldap.x86_64 0:5.4.31-37.el6.art   php-mbstring.x86_64 0:5.4.31-37.el6.art
  php-mcrypt.x86_64 0:5.4.31-37.el6.art php-mysql.x86_64 0:5.4.31-37.el6.art  
  php-odbc.x86_64 0:5.4.31-37.el6.art   php-pdo.x86_64 0:5.4.31-37.el6.art    
  php-xml.x86_64 0:5.4.31-37.el6.art    php-xmlrpc.x86_64 0:5.4.31-37.el6.art 

Complete!
[root@iZ25vqhgbx2Z freetds-0.91]#

2、php是用源码编译安装

cd /usr/local/src/php-5.3.15/ext/mssql #进入php源码包的ext下mssql目录

/usr/local/php5/bin/phpize

./configure --with-php-config=/usr/local/php5/bin/php-config --with-mssql=/usr/local/freetds #配置

注意:--with-mssql=/usr/local/freetds #是指freetds的安装路径

make #编译

make install #安装

vi /usr/local/php5/etc/php.ini #编辑,在最后位置添加下面一行

extension = "mssql.so"

:wq! #保存退出

3、重启LAMP或者LNMP

service httpd restart #重启apache

service php-fpm restart #重启php-fpm

三、测试php连接SQL Server 2000数据库

进入php程序目录,新建一个测试文件

cd /usr/local/nginx/html #请改为自己的网站目录

vi sql.php #添加以下内容

<?php

$mssql=mssql_connect("192.168.21.134","sa","123456");

if ($mssql) {

echo "Connent Mssql Succeed";

}

else {

echo "connent Mssql Error!";

}

?>

:wq! #保存退出

注意:这里的192.168.21.134必须要和/usr/local/freetds/etc/freetds.conf中的[192.168.21.134]完全一样

在浏览器中打开,出现下面的界面,连接成功

可以在新建一个文件

vi index.php

<?php

phpinfo();

?>

在浏览器中打开,能找到mssql,说明配置成功,如下图所示

至此,Linux下php连接SQL Server 2000数据库配置完成

 

0
0
分享到:
评论

相关推荐

    基于Linux下PHP连接SQL Server方法

    echo "connect sqlserver error"; exit; } mssql_select_db("database_name", $msdb); $result = mssql_query("SELECT top 5 * FROM table", $msdb); while ($row = mssql_fetch_array($result)) { var_dump($...

    Linux Php连接SQLServer数据库

    ### Linux环境下通过PHP连接SQL Server数据库 在Linux环境中利用PHP连接SQL Server数据库是常见的操作需求之一,尤其是在处理跨平台数据库应用时。本文将详细介绍如何在Linux系统上配置环境,以便PHP能够成功连接到...

    linux操作系统配置ODBC数据源连接SQL Server

    ### Linux操作系统配置ODBC数据源连接SQL Server #### 概述 在Linux环境中,通过配置ODBC(Open Database Connectivity)数据源来连接SQL Server是一种常见的需求。ODBC提供了一种标准的方式来访问各种数据库管理...

    php连接sqlserver数据库驱动.rar

    "php连接sqlserver数据库驱动.rar"这个压缩包很可能是包含PHP连接SQL Server所需的驱动程序,如PDO_SQLSRV或sqlsrv。本文将详细解释如何使用PHP连接到SQL Server数据库,以及相关的关键知识点。 首先,你需要确保你...

    Linux 配置php链接sqlserver.docx

    在Linux环境中配置PHP 5.6.23以连接到SQL Server,主要涉及以下几个关键步骤,包括安装FreeTDS、验证FreeTDS、下载PHP源代码、安装PHP扩展以及配置PHP.ini。以下是对这些步骤的详细说明: 1. **安装FreeTDS**: ...

    Linux平台下访问Windows平台的SQL Server数据库的方法.pdf

    在SQL Server数据库服务器上,笔者使用的是SQL Server 7.0(经实际测试,本文中的程序在SQL Server 2000下工作也正常)。注意其认证方式为SQL Server和Windows NT混合认证。两台服务器应联网(局域网或广域网),在...

    PHP连接sqlserver数据库

    在PHP编程中,连接到SQL Server数据库是一项常见的任务,尤其对于那些使用PHP作为后端语言,而数据库系统选择SQL Server的项目。以下是一份详细的知识点解析,涵盖了PHP连接SQL Server所需的关键步骤、可能遇到的...

    php连接sql server插件

    在实际应用中,开发者还需要注意兼容性问题,比如PHP版本与SQL Server版本之间的匹配,以及在不同操作系统(如Windows和Linux)上的差异。同时,安全性也是关键,应确保使用预处理语句和参数化查询来防止SQL注入攻击...

    php连接sqlserver所需sqlsrv扩展

    首先,标题提到的"php连接sqlserver所需sqlsrv扩展"是指在PHP环境中,为了能够成功地与SQL Server数据库通信,我们需要安装并启用`sqlsrv`扩展。通常,PHP默认并不包含这个扩展,因此需要额外安装。描述中指出,官方...

    Linux下php连接SQLServer 2000数据库的配置方法

    实现目的:Linux服务器中的php程序能够连接到Windows服务器中的SQL Server 2000数据库 具体步骤: 一、在Linux服务器中安装freetds 1、安装编译工具及驱动程序 yum install make apr* autoconf automake gcc gcc-c

    ubuntu+php5.6环境下连接sqlserver2008扩展库 mssql.so+pdo_dblib.so

    ubuntu14.04+php5.6环境下连接sqlserver2008扩展库 mssql.so+pdo_dblib.so,编译方法:http://blog.csdn.net/hanzengyi/article/details/52054862

    Linux编译mssql扩展使用php连接sqlserver2008的使用步骤

    在Linux环境下,将PHP与Microsoft SQL ...通过以上步骤,可以在Linux上配置PHP以连接到SQL Server 2008,从而实现跨平台的数据交互。这为Linux服务器上的Web应用提供了与Windows环境下的SQL Server数据库交互的能力。

    php7的sqlserver扩展sqlsrv扩展安装,7.0-7.1-7.2所有扩展

    在PHP开发中,有时我们需要连接到SQL Server数据库,这时就需要使用到特定的扩展。本文将详细阐述如何在PHP 7.0、7.1和7.2版本中安装sqlsrv和pdo_sqlsrv扩展,以便与SQL Server进行交互。 首先,sqlsrv是微软提供的...

    php连接sqlserver扩展文件.rar

    "php连接sqlserver扩展文件.rar" 提供的正是这样一个扩展,使得PHP能够与Microsoft SQL Server进行交互,这对于开发基于PHP的手游后台系统至关重要。在本文中,我们将深入探讨如何使用PHP连接SQL Server以及涉及的...

    Microsoft Drivers for PHP for SQL Server的有版本

    Microsoft Drivers for PHP for SQL Server的有版本,Microsoft® ODBC Driver 11 for SQL Server,Microsoft® ODBC Driver 13 for SQL ...SQLSRV30.EXE-5.2所有版本,支持PHP连接SQLServer的ODBC驱动和扩展模块。

    thinkphp5 连接SqlService需要的扩展

    `thinkphp5 连接SqlService需要的扩展`这个主题主要涉及如何在ThinkPHP5框架中配置和使用SQLServer数据库服务,这里我们详细探讨一下相关的知识点。 首先,`SqlService`通常指的是SQL Server服务,它是一个流行的...

    thinkphp5解决sqlserver链接问题

    工作需要用到php5.5连sqlserver 2008 R2,发现最新版的php内置已经不支持mssql 了,需要用到sqlsrv。 微软提供了Microsoft Drivers for PHP for SQL Server。

Global site tag (gtag.js) - Google Analytics