【发布时间】:2017-11-30 22:33:33
【问题描述】:
我在尝试连接数据库的 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 来源 ~/.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
【问题讨论】:
-
您是否也完成了上述指南的第 2、3、4 和 5 步?如果是这样,是否有任何错误?运行
php -i是否显示任何提及sqlsrv模块? -
我收到上述错误:另外,当我运行
php -i并搜索sqlsrv时,我发现:sqlsrv sqlsrv support => enabled ExtensionVer => 4.3.0 Directive => Local Value => Master Value sqlsrv.ClientBufferMaxKBSize => 10240 => 10240 sqlsrv.LogSeverity => 0 => 0 sqlsrv.LogSubsystems => 0 => 0 sqlsrv.WarningsReturnAsErrors => On => On
标签: php mysql sql macos-high-sierra