我在尝试连接数据库的macOS上遇到此错误。我很确定这是由于缺少驱动程序,但自更新以来我无法找到High Sierra / 10.13.1的相关内容。
Fatal error: Call to undefined function sqlsrv_connect()
我在下面找到了一个指南: https://github.com/Microsoft/msphpsql
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew tap
brew tap homebrew/dupes
brew tap homebrew/versions
brew tap homebrew/homebrew-php
brew install php71 --with-pear --with-httpd24 --with-cgi
echo 'export PATH="/usr/local/sbin:$PATH"' >> ~/.bash_profile
echo 'export PATH="/usr/local/bin:$PATH"' >>
我在尝试连接数据库的macOS上遇到此错误。我很确定这是由于缺少驱动程序,但自更新以来我无法找到High Sierra / 10.13.1的相关内容。
致命错误:调用未定义的函数sqlsrv_connect()
我在下面找到了一个指南:https://github.com/Microsoft/msphpsql
〜/ .bash_profile中 source~ / .bash_profile
然而,这没有帮助我仍然得到这个错误。自更新操作系统以来,我根本无法连接到数据库。我似乎无法发现我需要的东西。有什么想法吗?
我收到了这些错误:
Warning: homebrew/dupes was deprecated. This tap is now empty as all its formulae were migrated.
Warning: homebrew/versions was deprecated. This tap is now empty as all its formulae were migrated.
Warning: homebrew/php/php70 7.0.25_17 is already installed
Error: Formulae found in multiple taps:
* microsoft/msodbcsql/msodbcsql
* microsoft/mssql-release/msodbcsql
Please use the fully-qualified name e.g. microsoft/msodbcsql/msodbcsql to refer the formula.
Error: Formulae found in multiple taps:
* microsoft/msodbcsql/mssql-tools
* microsoft/mssql-release/mssql-tools
Please use the fully-qualified name e.g. microsoft/msodbcsql/mssql-tools to refer the formula.
Warning: autoconf 2.69 is already installed
574: module php7_module is already loaded, skipping
httpd not running, trying to start
答案 0 :(得分:0)
这不是一个简单的修复,它需要一个高级几个小时。
基本上,要点是 homebrew ,我发现的许多命令都安装了几个不同版本的PHP和我系统上的驱动程序。
他们没有遵循逻辑约定,所有安装都在不同的文件夹结构和不同的地方。
基本上所有这些都必须删除,然后安装正确的版本和驱动程序。