Home > mac | php > Mac: Connecting to msSQL Server on Mac

Mac: Connecting to msSQL Server on Mac

This is for ppl who are mac lover and mysql lover but due to work requirement have to conenct to mssql server on their mac.

if you had installed PHP Apache Module from Entropy.ch the following instruction is for you, else, you may try my earlier post on installing msSQL extension for php in *nix/Centos Server, largely used by WHM/cPanel.

entropy’s php for the version i install for mac is still in beta. but it comes with freeTDS installed, i am not too sure about the earlier versions. so to conenct to mssql server you jus have to configure your freetds.conf file which should be located in, the path,


you may had name “php5” with something else instead.

vi this file or open with a text editor and insert the following line at the end.

port = 1433
tds version = 8.0

note that MSHOSTNAME for both case mus be the same, and is something like or mssql.somehost.com etc. it should be the hostname you are connecting to probably in your php script.

ie: $link = mssql_connect(‘MSHOSTNAME’,’username’,’password’) or die(‘Damn! Unable to connect to msSQL Server!’);

tds version depends on the mssql server version you are connecting to, gennerally 8.0, and port is standard 1433 unless your remote mssql server connects on weird port number.

save, and you are done!

, , ,


Leave a Reply
  1. wpageiii 09/03/20

    I am getting some error when I install from entropy “run postflight script for entropy php” is the message I get…

    I am on OSX 10.5.6. I tried both installing w Apache 1.3 and Apache 2.0

    Also I have previously installed MAMP but I have stopped the Servers…

    Any help would be appriecated…

  2. wpageiii 09/03/20

    Sorry to bother you…I did not see the forum on the entropy site…My question seems to have been answered many times over there

  3. Steven 09/03/20

    hi wpageiii, you are most welcome!
    yes, entropy forum have lots of helpful solutions there

Leave a Reply

Your email address will not be published. Required fields are marked *


Listed below are links to weblogs that reference
Mac: Connecting to msSQL Server on Mac from How to Get it Working