Using PHP with MS SQL Server - Required Packages
(Page 2 of 5 )
You'll need to enable the sybase or mssql modules in your PHP installation. Most Linux and the common BSD distributions make it an option when installing PHP. If yours doesn't, the steps to get it into place are simple.
The first dependency is freetds, the library that enables access to Sybase and SQL Server databases. You can download it from http://www.freetds.org. It installs like most open source packages, with the cycle of configure, make, make install.
Next you need to build your PHP installation so that it knows about freetds. That's as simple as adding --with-mssql to the configure switches in most places. Freetds installs by default in /usr/local, so you'll probably need to modify the switch slightly to read --with-mssql=/usr/local
Now copy your new binaries into place and activate them in your php.ini file. There is already an entry in the default INI file to enable mssql, and it just needs to have the comments removed. It's usually necessary to restart your web server after adding the module.
You can verify that the module is installed and happy by checking the php_info() command. In the list of modules should be the mssql module. If you're on a UNIX system, especially FreeBSD or OpenBSD, the mssql module often doesn't appear even when you do have access to it. If the Sybase module is active, mssql is working too. Explicitly specifying the --with-mssql option to configure will usually force php_info() to divulge the mssql module.
Next: Optional Packages >>
More MS SQL Server Articles
More By Clay Dowling