wampserver php和sql,PHP 5.4和MSSQL - Wampserver(PHP 5.4 & MSSQL - Wampserver)

PHP 5.4和MSSQL - Wampserver(PHP 5.4 & MSSQL - Wampserver)

我正在尝试将我的PHP,MSSQL函数更新为PHP 5.4支持的新版本。 我已经做了所有事情,到处搜索,但我无法让它工作。

我已经将WampServer 32位安装到我的C:驱动器,我已经为PHP安装了SQL驱动程序。 我已经确定我选择的软件包是3.0( http://www.microsoft.com/en-gb/download/details.aspx?id=20098 )并且我正确安装了它们。 我将'php_sqlsrv_54_ts.dll'放入wamp / bin / php / ext中的ext文件夹中,并将'extension = php_sqlsrv_54_ts.dll'添加到wamp / bin / php中的php.ini文件中。

接下来,我成功启动了所有服务,然后转到我的本地主机,发现我收到了这个错误:

Call to undefined function sqlsrv_connect() in C:\wamp\www\launcher\Login2.php on line 11

更多信息:

Running Windows 7 SP1 Ultimate 64 bit

Download Wamp Server 2 for 32 Bit

Apache : 2.4.4

MySQL : 5.6.12

PHP : 5.4.16

PHPMyAdmin : 4.0.4

SqlBuddy : 1.3.3

XDebug : 2.2.3

Running it on my localhost/127.0.0.1

Using port 8080 in Apache

Enabled pdo extensions in php.

Using the php_sqlsrv_54_ts.dll

Restarted Wamp several times.

I am trying to update my PHP, MSSQL functions to the newer ones which are supported by PHP 5.4. I have done everything and searched everywhere but I just can't get it to work.

I have installed WampServer 32 Bit to my C: drive and I have installed SQL drivers for PHP. I have made sure that the package I chose was 3.0 (http://www.microsoft.com/en-gb/download/details.aspx?id=20098) and I installed them correctly. I put the 'php_sqlsrv_54_ts.dll' into the ext folder which is in wamp/bin/php/ext and I added the 'extension=php_sqlsrv_54_ts.dll' to the php.ini file which is in wamp/bin/php.

Next I started all the services successfully and then went to my local host to find out that I was receiving this error:

Call to undefined function sqlsrv_connect() in C:\wamp\www\launcher\Login2.php on line 11

Further Information:

Running Windows 7 SP1 Ultimate 64 bit

Download Wamp Server 2 for 32 Bit

Apache : 2.4.4

MySQL : 5.6.12

PHP : 5.4.16

PHPMyAdmin : 4.0.4

SqlBuddy : 1.3.3

XDebug : 2.2.3

Running it on my localhost/127.0.0.1

Using port 8080 in Apache

Enabled pdo extensions in php.

Using the php_sqlsrv_54_ts.dll

Restarted Wamp several times.

原文:https://stackoverflow.com/questions/17394210

更新时间:2019-12-19 23:40

最满意答案

我修好了它。 我以前通过wamp服务器控件进入PHP扩展并勾选了php_pdo_mssql和php_mssql,但现在我已经取消选中这些我不再得到错误,而是数据库连接失败。 我不熟悉新的SQL Server连接。 在我使用mssql_connect和我的主机作为'Farbod-PC \ SQLExpress'之前,我仍然使用这个主机,它工作正常。

I fixed it. I had previously gone into PHP extension via wamp server controls and ticked php_pdo_mssql and php_mssql but now that I have unchecked these I don't get the error anymore but rather a database connect fail. I am not familiar with the new sql server connections. Before I used mssql_connect with my host being as 'Farbod-PC\SQLExpress' I still use this host and it works fine.

2013-07-23

相关问答

这是我如何做到的。 从这里下载libsodium> 用于PHP 7.0 , 用于PHP 5.6和用于PHP 5.5 (全部为x64)。 #请注意,请从这里下载相应的x86-32位或x64-64位扩展名 提取下载的文件并将libsodium.dll复制到wamp-> bin-> php-> php5(x).x.xx文件夹 复制php_libsodium.dll从提取的文件到wamp-> bin-> php-> php5(x).x.xx - > ext 现在点击WAMP系统托盘图标。 转至PHP->

...

我看到您正在使用Windows Server 2003.您需要在Windows Server 2003中使用PHP for SQL Server驱动程序的2.0版。您不能使用最新的3.0版驱动程序。 但是,您需要使用PHP for SQL Server驱动程序的3.0版才能使用PHP 5.4+。 基本上,您需要将操作系统更新到Windows Server 2008才能使用PHP 5.4+(如果您需要SQL Server驱动程序支持)。 http://msdn.microsoft.com/en-us

...

mysql_query不是mssql_query mysql_query is not mssql_query

我修好了它。 我以前通过wamp服务器控件进入PHP扩展并勾选了php_pdo_mssql和php_mssql,但现在我已经取消选中这些我不再得到错误,而是数据库连接失败。 我不熟悉新的SQL Server连接。 在我使用mssql_connect和我的主机作为'Farbod-PC \ SQLExpress'之前,我仍然使用这个主机,它工作正常。 I fixed it. I had previously gone into PHP extension via wamp server control

...

问题是我猜的字符串和int值 你正在传递一个字符串,使用它 App\Address::searchAdress(1330)->get();

更改范围查询 return $query->where('adress', '=', $searchTerm);

the problem is i guess with the string and int value you are passing a string, work with this App\Address::searchAdress(13

...

左键单击wamp> php> version> get more> 选择你想要的版本并下载它。 安装exe。 左键单击wamp> php> version> php xxx.x 更新:我已经进一步调查:在2版本之间切换似乎并不那么简单...请查看本指南 ,它有非常详细的信息 这也许也有帮助 left click wamp> php>version> get more> select the version ytou want and download it. install the exe. le

...

如果你在窗口,我猜你是 打开控制面板 - >系统 - >高级选项卡 - >环境变量选择下方区域的路径单击编辑将PHP的路径从C:\ wamp \ bin \ php \ php5.3.13更改为C:\ wamp \ bin \ php \ php5 .4.0或您拥有的任何PHP 5.4.x版本 请注意,如果您在某些其他目录中安装了wamp而不是默认目录,请在编辑之前检查资源管理器中的文件夹 我认为你现在应该没问题 If you are in windows as I guess you are O

...

您可能会收到错误,因为该函数实际上是scard_list_readers()而不是SCardListReaders()因为错误显示在您的帖子中。 但在使用大多数功能之前,您需要先建立一个上下文。 尝试: $context = scard_establish_context();

$readers = scard_list_readers($context);

print_r($readers);

// then when you have your card reader's identity

...

终端中的版本和verison wamp正在使用的版本可能不同。 在一个wamp项目中创建一个php文件并将其放入其中。 <?php

phpinfo();

?>

转到浏览器中php文件的url,这将显示wamp中的apache服务器正在使用的php版本。 您可以使用本教程更改它。 在wamp中更改php版本 祝你好运! The version in your terminal and the verison wamp is using may be different. In a wamp

...

使用ODBC,SQLSrv扩展仅适用于Windows。 Use ODBC, the SQLSrv extension is only intended for use on Windows.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值