dqan70724 2017-02-07 06:12
浏览 52

如何在microsoft AZURE服务器(PaaS)中安装msodbcsql

Okay, so basically I have now deployed an Web App in Azure, but I cannot seem to make it to connect to a separate SQL SERVER. I have provided all the desired App settings for the connection but it seems no good.

Now I search for possible causes:

  1. PHP ext dlls are missing for msodbcsql which are

php_pdo_sqlsrv_56_ts.dll and php_sqlsrv_56_ts.dll

I already added this dll's and referenced them accordingly base on this document Configure via ini settings

  1. Now the uncertainty that msodbcsql is installed in Azure.

Now this is what I am having problem with.

So in my case in number 2 I tried copying the installer to Azure D:/home/

and run this in the command line

msiexec /quiet /passive /qn /i msodbcsql.msi IACCEPTMSODBCSQLLICENSETERMS=YES ADDLOCAL=ALL

which is suppose to install the .msi installer but i always get an

ACCESS IS DENIED

error.

is there another way around??

  • 写回答

1条回答 默认 最新

  • doudizhi947129 2017-02-07 09:12
    关注

    Basically Azure has already set up extension php_sqlsrv.dll & php_pdo_sqlsrv.dll for us, so we ourselves do not need to install any driver to connect SQL SERVER.

    You could check the php.ini file which can be found at D:\local\Config\PHP-<version>\php.ini with Kudu console to confirm that.

    enter image description here

    Also, you can check that with phpinfo() function in your application.

    enter image description here enter image description here

    And I have tested it with the following lines of code and got it worked.

    <?php
    $serverName = "serverName\sqlexpress"; //serverName\instanceName
    $connectionInfo = array( "Database"=>"dbName", "UID"=>"userName", "PWD"=>"password");
    $conn = sqlsrv_connect( $serverName, $connectionInfo);
    
    if( $conn ) {
         echo "Connection established.<br />";
    }else{
         echo "Connection could not be established.<br />";
         die( print_r( sqlsrv_errors(), true));
    }
    ?>
    

    enter image description here

    评论

报告相同问题?

悬赏问题

  • ¥15 多址通信方式的抗噪声性能和系统容量对比
  • ¥15 winform的chart曲线生成时有凸起
  • ¥15 msix packaging tool打包问题
  • ¥15 finalshell节点的搭建代码和那个端口代码教程
  • ¥15 Centos / PETSc / PETGEM
  • ¥15 centos7.9 IPv6端口telnet和端口监控问题
  • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 海浪数据 南海地区海况数据,波浪数据
  • ¥20 软件测试决策法疑问求解答