How To - Mac OS X
The following is a tutorial on how to configure and install all the tools you need to manage a Microsoft SQL Server using phpMSAdmin. This tutorial covers compiling everything from scratch, what seems like a daunting task at first, but seems far more difficult then it actually is. You will need developer tools installed. This comes free with all Apple computers or as a free download from the Apple Developer Connection website. If you choose to download it, you’ll need to sign up as a developer, but don’t worry, it is free. Note that this entire tutorial uses version numbers as of the writing of this tutorial. Substitute the version number of the version you are downloading where applicable.First we will compile and configure FreeTDS, the amazing open-source software library that makes connections to SQL Server without using ODBC possible. First download the latest Stable Release of the FreeTDS source code and then do the following in the Terminal:
- Navigate to where you’ve saved the tar file and extract it with “tar -zxf freetds-stable.tgz”.
- Enter the directory that is created. As of the time of this writing it would be “cd freetds-0.63″.
- Configure the compile with:
- If you see any error messages at this point, it means you’ve not installed the developer tools correctly or your install is incomplete. Re-install developer tools and try again.
- Begin the build process by typing “make”.
- When the building has completed, type “make install” to copy the compiled libraries and binaries to there final destination.
- You can now delete the FreeTDS source code.
./configure --prefix=/usr/local/freetds_0.63 --with-tdsver=8.0 --enable-msdblib
The next step is to compile our own version of Apache. For our purposes the 2.0 series feature-set and complexity is unwarranted and unneeded so we’ll be using the 1.3 series. Just like before you will need to download the most recent version in the 1.3 series of Apache from the download section of the Apache website and continue using the terminal for the following instructions:
- Navigate to where you’ve saved the tar file and extract it with “tar -zxf apache_1.3.36.tar.gz”.
- Enter the directory that was created with “cd apache_1.3.36″.
- Normally I’d use a fairly large compile string for Apache to strip out all the modules I don’t use. If your interested in what options I use when compiling Apache you can view it via this link. For the purposes of this tutorial you should configure with:
- When this completes your ready to build with “make”.
- Finally, install the binaries and libraries you’ve just created with “make install”. We’ll leave the configuration of Apache till after we install PHP since PHP modifies the Apache configuration file automatically.
- You can now delete the Apache source code.
./configure --prefix=/usr/local/apache_1.3.36 --enable-module=so
Next we will download and compile PHP. You’ll need to download the “tar.gz” version under “Complete Source Code” on the PHP download page. Then do the following:
- Navigate to where you’ve saved the tar file and extract it with “tar -zxf php-5.1.4.tar.gz”.
- Enter the directory that was created with “cd php-5.1.4″.
- Now we’re ready to compile PHP. Once again, I will be giving you a very basic compile line to simplify the process. If you’d like to see the large optimized compile string I use, click here. To begin the compile process do the following in the PHP dir:
- When that completes, we are ready to begin compiling with “make”.
- After that completes, you can now complete the install with “make install”.
- Copy the default “php.ini-recommended” file to your “/usr/local/lib” directory to get you a basic PHP configuration by doing “cp php.ini-recommended /usr/local/lib/php.ini”.
- You can now delete the PHP source code.
./configure --with-apxs=/usr/local/apache_1.3.36/bin/apxs --with-mssql=/usr/local/freetds_0.63
(More to come soon.)