Mac: Connecting to msSQL Server on Mac

Filed in mac | php 3 Comments

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 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 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!

, , ,