2014-10-24 11:35
浏览 68

从运行PHP 5.5的Azure网站连接Azure SQL数据库?

If you setup an Azure website to run PHP 5.5, the "sqlsrv" extension disappears, presumably because the current release of that extension doesn't support past PHP 5.4. As you can see from that post, Microsoft has been "working on" an updated sqlsrv extension since July 2013. The official blog for this extension hasn't been updated since Oct 2012, and the last post that was actually about the sqlsrv extension is from March 2012.

There is an unofficial version of the sqlsrv extension that supports PHP 5.5, but you can't install custom PHP extensions on an Azure managed web site.

As far as I can tell, that means you cannot connect to a Azure SQL data from an Azure manage web site, and it doesn't look like Microsoft is in a rush to fix this. I'm just about to give up on using PHP 5.5 + SQL Server on Azure.

However, I'm hoping there is something I'm missing. Is it possible to run a PHP 5.5 app as a managed web site on Azure and connect to SQL Server?

图片转代码服务由CSDN问答提供 功能建议

如果您设置Azure网站以运行PHP 5.5,则“sqlsrv”扩展名将消失,大概是因为当前版本的 该扩展不支持过去 PHP 5.4 。 正如您在该帖子中所看到的,自2013年7月以来,Microsoft一直在“开发”更新的sqlsrv扩展。 此扩展程序的官方博客自2012年10月以来尚未更新,最后一篇帖子是实际上关于sqlsrv扩展 是从2012年3月开始的。

有一个支持PHP 5.5的sqlsrv扩展的非官方版本,但您无法在Azure托管网站上安装自定义PHP扩展 。

据我所知,这意味着您无法从Azure管理网站连接到Azure SQL数据,而且看起来微软并不急于修复 这个。 我即将放弃在Azure上使用PHP 5.5 + SQL Server。

但是,我希望有一些我不知道的东西。 是否可以在Azure上运行PHP 5.5应用程序作为托管网站并连接到SQL Server?

  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • duanguane1670 2014-12-22 20:46

    Microsoft has now released support for PHP 5.5 and 5.6 connections via their Microsoft Drivers for PHP for SQL Server PHP extension. Version 3.2 (current as of April 1st, 2015) supports PHP 5.4, 5.5, and 5.6.

    As a result, Azure PHP web apps should be able to connect to Microsoft SQL Server "out of the box" without having to install any additional drivers.

    Note on Azure terminology change since question was posted: "Websites is now Web Apps in App Service"

    解决 无用
    打赏 举报
  • du1913 2014-10-24 12:44

    You can start with installing the above-mentioned custom PHP extension on Azure Web Site. It is surely supported process and is well described here.

    So make your site running with the custom PHP extension while waiting for the official one.

    解决 无用
    打赏 举报

相关推荐 更多相似问题