Archive for the ‘linux’ Category

How to compile MSSQL support into PHP in Ubuntu Dapper Drake

Tuesday, May 30th, 2006

This information is specific to Ubuntu Dapper Drake, but it may work on other versions of the software. This will allow you to connect to Microsoft’s SQL Server 2000 to use Apache and PHP to connect to a MSSQL database.

  • Install support packages
sudo aptitude install freetds-dev
sudo aptitude install tdsodbc
  • Modify the Freetds file to access the server: sudo nano /etc/freetds/freetds.conf (not sure if this is necessary)
# Our SQL Server
[FSData]
host = 192.168.x.x
port = 1433
tds version = 8.0
  • Tell UnixODBC where to find the FreeTDS driver and give it a name:
    • Modify /etc/odbcinst.ini
[FreeTDS]
Description = FreeTDS 0.61-5 Deb
Driver = /usr/lib/odbc/libtdsodbc.so
Setup = /usr/lib/odbc/libtdsS.so
FileUsage = 1
CPTimeout = 5
CPReuse = 5
    • Modify the odbc.ini file: sudo nano /etc/odbc.ini
[Products]
Description = Products on Our MSSQL Server
Driver = FreeTDS
Servername = FSData
Database = Products
  • Download dpkg
sudo aptitude install dpkg-dev
  • Download php-src
sudo aptitude source php5
  • Go into the new php5 directory
  • Edit the debian/rules file - add the following to the common config sudo nano debian/rules
--with-mssql
  • build dependencies
sudo aptitude build-dep php5
  • build the package
sudo dpkg-buildpackage
  • install the new PHP w/ MSSQL
sudo dpkg -i php5_5*.deb
  • copy the new libphp5.so to the correct directory (otherwise it will still use the old one)
sudo cp ~/php5-*/apache2-build/libs/libphp5.so /usr/lib/apache2/modules/libphp5.so
  • restart Apache
sudo /etc/init.d/apache2 restart

Fedora Core 5 on Dell Poweredge 1850

Tuesday, April 18th, 2006

I tried installing Fedora Core 5 on a Dell Poweredge 1850 with Perc 4e/si raid at work today. Unfortunately the driver (megaraid) seems to have a bug that causes the system to crash. Im not alone in the problem and it seems others have had the same thing happen.

Im going to give Ubuntu a try to see if I can avoid switching back to Debian. Not that I dont like Debian, but it is just a big pain to get things set up.

Update: I got Ubuntu installed and it works like a dream. I expected this since it is built on debian. It is much easier to manage and is better documented. The community is a lot less 1337 than the Debian community. It makes it a lot easier to get help when linux is not your full time job / life.