2

I have mac os i am running PHP 5.3.8 using xampp, I want to run an application which uses MSSQL I am unable to find any drivers for it. When I searched for MSSQL for PHP on mac I found freetds but i am unable to install freetds because i don't have gcc compiler installed on my mac and "make install" command does not work. I can't install gcc compiler because it can only be done using xcode and I am running osx 10.7.2 so i can't install xcode(latest requirement is 10.8.x +). Kindly suggest any other way to install MSSQL drivers on MAC

Alex
  • 457
  • 3
  • 16

2 Answers2

2

EDIT: I'm pretty sure you're going to need a GCC compiler to make this happen. You should be able to install a 10.7 compatible version of XCode: https://discussions.apple.com/message/23199440#23199440

You'll need to install unixODBC and FreeTDS. The following link gives instructions for installing each from source, or you may install via Homebrew or MacPorts.

From source: http://2tbsp.com/content/connect-ms-sql-server-and-sybase-ase-mac-os-x-and-linux-unixodbc-and-freetds

Homebrew instructions: http://www.acloudtree.com/how-to-install-freetds-and-unixodbc-on-osx-using-homebrew-for-use-with-ruby-php-and-perl/

With these libraries installed and configured, you should then be able to configure PHP to connect via PDO or MSSQL extensions.

Chad Kieffer
  • 491
  • 4
  • 8
  • i have installed macports for my OS but still not able to install freeTDS. Ill check if I can install older version of xcode. – Alex Feb 28 '14 at 03:49
  • In all honesty, although I used MacPorts for many years, Homebrew is probably a better option here. – Chad Kieffer Feb 28 '14 at 16:09
  • 1
    Here's a direct link to a page including Xcode 4.6.3 download: https://developer.apple.com/downloads/index.action?q=xcode – Chad Kieffer Feb 28 '14 at 16:10
0

Have you checked out dblib? Apparently, it's supposed to be able to connect to SQL Server from PHP on a Mac. Check out a Stack Overflow answer about it here.

Community
  • 1
  • 1
brazilianldsjaguar
  • 1,409
  • 1
  • 20
  • 45
  • dblib is supposed to be available only in dll "pdo_dblib.dll" or "php_dblib.dll" i can't get a *.so file for mac extensions – Alex Feb 28 '14 at 03:46