0

I’m getting this error on macOS trying to connect to a DB. I’m pretty sure it’s due to missing drivers but I can’t find the relevant ones for High Sierra / 10.13.1 since updating.

Fatal error: Call to undefined function sqlsrv_connect()

I found a guide below: 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"' >>  

I’m getting this error on macOS trying to connect to a DB. I’m pretty sure it’s due to missing drivers but I can’t find the relevant ones for High Sierra / 10.13.1 since updating.

Fatal error: Call to undefined function sqlsrv_connect()

I found a guide below: https://github.com/Microsoft/msphpsql

~/.bash_profile source ~/.bash_profile

However this hasn't helped I'm still getting this error. I can't connect to the DB at all since updating OS. I can't seem to discover what I need. Any ideas?

I'm getting these errors:

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
Adam
  • 41
  • 1
  • 8
  • Have you also completed steps 2, 3, 4 & 5 of the aforementioned guide? If so, were there any errors? Does running `php -i` show any mention of `sqlsrv` module? – Jirka Hrazdil Nov 23 '17 at 16:33
  • I'm getting the errors above: Also when I run `php -i` and search for `sqlsrv` this is what i find: `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` – Adam Nov 27 '17 at 10:03

1 Answers1

0

This wasn't an easy fix, it took a senior several hours.

Basically the gist is that homebrew and many of the commands I found installed several different versions of PHP and the drivers on my system.

They don't follow a logical convention, all the installs were in a different folder structure and in different places.

Essentially all of this had to be removed and then the correct version and driver installed.

Adam
  • 41
  • 1
  • 8