Xampp中的PHP PDO MSSQL? [英] PHP PDO MSSQL in Xampp?

查看:79
本文介绍了Xampp中的PHP PDO MSSQL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好,这是我的情况:

我已经在服务器上安装了Xampp(v1.8.2),以发布我正在为网络中的某些人制作的网络程序(php,html). 第一次,我必须连接到MSSQL 2008服务器而不是MYSQL(phpmyadmin). 在过去的几年中,我一直与MySQL api一起工作,并与MySQLi一起工作. 我已经阅读了互联网,我必须使用PDO,这样我才能成功连接到MS数据库.

I have installed Xampp (v1.8.2) on my server to publish a webprogram i am making (php, html) for some people in my network. For the first time i have to connect to MSSQL 2008 server instead of MYSQL (phpmyadmin). over the past years i've always worked with the MySQL api and a little with MySQLi. I have read over the internet i must use PDO so i can succesfully connect to the MS database.

如我所见,PDO未安装/激活. 当我查看PHP.ini文件时,唯一看到的是:

As i can see PDO is not installed/activated. When i look into the PHP.ini file the only thing i see is:

extension=php_mssql.dll

但没有

extension=php_pdo_mssql.dll

我已经阅读了分配(即我必须安装soms dll文件,我必须手动安装apache,PHP,PDO)

i've read allot (i.e that i have to install soms dll files, that i have to install apache, PHP, PDO manually)

与我的mssql数据库成功建立连接的好方法是什么?

What is the good way to make a successful connection to my mssql database?

谢谢

推荐答案

有两个MSSQL扩展:SQLSRV

There are two MSSQL extensions: SQLSRV http://php.net/manual/en/book.sqlsrv.php (if your server/computer is a Windows box) and MSSQL http://php.net/manual/en/book.mssql.php (if your server/computer is a Linux or OSX box)

如果您使用Windows,请使用SQLSRV PHP扩展名 http ://www.microsoft.com/zh-cn/download/details.aspx?id = 20098 .

If you are using Windows: use the SQLSRV PHP extension http://www.microsoft.com/en-us/download/details.aspx?id=20098.

如果您使用Linux/Debian,请按照本文中的说明进行操作.如果您使用OSX,请尝试使用类似本文

If you use Linux/Debian follow the instructions in this article. If you use OSX, try something like this article http://blog.andyhunt.info/2013/11/29/php-mssql-pdo_dblib-freetds-support-on-mac-osx-10-9-mavericks/.

我正在写一个与这两个扩展兼容的基本MSSQL数据库对象: https://github. com/janjuna/mssql-db

I am writing a basic MSSQL Database Object which is compatible with both the extensions: https://github.com/janjuna/mssql-db

这篇关于Xampp中的PHP PDO MSSQL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆