Watch the video
[youtube=http://www.youtube.com/watch?v=To-XOPgaGsQ]
Watch the video
[youtube=http://www.youtube.com/watch?v=To-XOPgaGsQ]
Once in a while in my high level application stack, web development world, I am thrown for a loop, and I have to venture down into the bowls of the LAMP stack, or MAMP stack in my case. A client for the company I work for jWeb has a desktop application that their entire company uses all day every day. This application is a win32 desktop application that is tied to a SQL Server 2005 database. We are tasked with building a web application that ties directly to this database, and adds our own custom special sauce to the mix. Needless to say the Microsoft Development platform is very windows centric, so I looked to an open source solution. As I usually do when I search for a software solution to my problems, I found a champion, FreeTDS. This software library allows linux (and therefore Mac OSX… freebsd is not linux I know) to be able to connect directly, not through ODBC, to SQL Server and execute sql statements (Stored Procedures too!!)
To give context to this solution, here is my current developer web server setup:
And here is my SQL Server Set Up
Couple of pitfalls to watch out for here with regards to your SQL Server Development machine:
Ok, before we can upgrade to FreeTDS and compile it with connections to SQL Server we need to download the FreeTDS library.
Download from here (ftp://ftp.ibiblio.org/pub/Linux/ALPHA/freetds/stable/freetds-stable.tgz).
Run these commands:
This will install FreeTDS to you /usr/local directory. It is important to put it in this location, cause of the following next steps.
Ok now, lets upgrade to 5.2.6 PHP.
Grab the source code from PHP.net.
Follow these steps:
Ok now here is the fun fun fun.
FreeTDS decided in release 0.82 to change the way that it installs its compiled libs. PHP (as of 5.2.6) has not release an official update to this problem. FreeTDS.org/news.html has recommended adding dummy files to allow the PHP extensions (mssql, pdo_dblib) to compile correctly. This soution is not really solving the problem, so I looked to the PHP developers to see if there is a better solution.
Low and behold, there was!
Two different links:
These two sites discuss the problem in depth. The great news, they provided a Patch to solve the problem!
Download it here. (http://overlays.gentoo.org/proj/php/browser/patches/php-patches/5.2.6/php5/freetds-compat.patch?rev=3488&format=raw)
Copy the patch file to your php src directory (/usr/local/src/php-5.2.6).
Run these commands:
This will patch the source code problems with FreeTDS 0.82 and PHP 5.2.6
Now compile php (based off of my settings):
You are off to the races!!!
You can now install open source tools such as:
I plan to use both, but Symfony will allow me to read the schema directly from the SQL Server, and build out ORM objects based on their schema!!!
Good luck!
P.S. Dont forget to restart Apache!!! PHP lives in memory based on the last apache restart, so you wont see changes reflected until you force restart apache.
Amazing
[youtube=http://www.youtube.com/watch?v=_TiQCJXpbKg]