May 15, 2007
Wierd issue on php-mssql
I’m not sure the reasoning yet and I have tried to look into it but for some reason finding the components for php to connect to a Microsoft SQL database is a needle in a haystack maneuver. I’m hopping it isn’t illegal because I have info here on how to get it up and running with php on fedora core 6. The principles may apply for other distro’s but given the lack of info on the subject I thought I would cover it briefly here just in case someone else was tearing their hair out like I was.
First step is to get freetds, and freetds-devel installed from livna.
rpm -Uhv http://rpm.livna.org/livna-release-6.rpm
this will download and install the repository. Once installed
yum install freetds-devel php-devel
This will get the packages installed that will be needed to build the php-mssql module if you have all the rest of the appropriate developer utilities installed. Next get the php-nonfree src rpm file from the remi repo at
http://remi.collet.free.fr/rpms/extras/
Also, don’t worry about the minor version number just make sure if you are running fc6 to get the fc6 version. Once you have the src rpm file downloaded run
rpmbuild –rebuild php-nonfree-5.1.6-1.fc6.src.rpm
Once this finishes if there are any dep errors you will have to resolve those as appropriate. If everything goes well and the process completes you need to check the /usr/redhat/RPMS/i386 folder for the php-mssql module. Once you find it run
rpm -Uhv php-mssql-5.1.6-1.i386.rpm
It should auto restart apache and you should be in business. Modify the /etc/freetds.conf file to include your server so you can reference it by name. I can’t for the life of me figure out why this module isn’t just included. I guess so long as it works like this I’m Ok with it but it would be nice for an officially supported release to be available.