Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/294.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
can';t将php连接到azure ms sql server数据库_Php_Sql Server_Macos_Azure_Mamp - Fatal编程技术网

can';t将php连接到azure ms sql server数据库

can';t将php连接到azure ms sql server数据库,php,sql-server,macos,azure,mamp,Php,Sql Server,Macos,Azure,Mamp,有人知道如何将php网站连接到azure上的ms sql server数据库吗? 目前我正在使用OSX Sierra 10.12.4、MAMP 4.1.1版和php7.1.1 $serverName = "your_server.database.windows.net"; $connectionOptions = array( "Database" => "your_database", "Uid" => "your_username", "PWD" => "your_pas

有人知道如何将php网站连接到azure上的ms sql server数据库吗? 目前我正在使用OSX Sierra 10.12.4、MAMP 4.1.1版和php7.1.1

$serverName = "your_server.database.windows.net";
$connectionOptions = array(
"Database" => "your_database",
"Uid" => "your_username",
"PWD" => "your_password"
);

$conn = sqlsrv_connect($serverName, $connectionOptions);
我得到了一个错误: 致命错误:未捕获错误:调用未定义的函数sqlsrv_connect()


有人知道我需要安装哪些软件包吗

您的计算机上似乎还没有安装Microsoft PHP驱动程序for SQL Server。可以在自述文件中找到分步安装说明:

MacOSX

brew tap microsoft/mssql-preview https://github.com/Microsoft/homebrew-mssql-preview
brew update
brew install msodbcsql
brew install mssql-tools
brew install autoconf

看看,是的,这正是我需要的,它起作用了。谢谢