rc3.org

Strong opinions, weakly held

Setting up OS X for a developer

This is quick document explaining the trials and travails of setting up a Powerbook G4 as a development box with Apache, PHP, MySQL, Ruby on Rails, Java, and Tomcat. After turning on the Powerbook and connecting to my wireless network, the computer automatically downloaded and installed all of the latest and greatest updates from Apple. I proceeded to install Firefox, Adium, Microsoft Office and some other standard productivity applications before turning to my real task — getting my development environment up and running.

I’ve been developing under Windows for years, so getting Java, Eclipse, Tomcat, Apache, PHP, and MySQL installed and running is second nature to me in that environment. I’ve also done the same on plenty of Linux boxes. The Mac is sort of a hybrid of both, and I’m still learning my way around.

I know that the Mac comes with Apache and PHP installed already, but I have no idea where they are or how they work, so I took the advice of some more clueful people and decided to install my own copies. I learned that the best approach here is to used Fink, which is a sort of package manager that makes it “easy” to build or install popular open source software under OS X. Installing Fink and Fink Commander was easy enough. I have always hated the Debian package manager (yes, I know everyone else loves it), but I managed to get MySQL installed without a hitch. I then moved on to Apache, which also installed easily enough.

Things got a bit hairy when I tried to install PHP5, which has about 75 dependencies, and kept whining when I tried to install it. After a few aborted attempts I gave up and tried to install the Subversion client. That failed too, so I installed the binary version of one of the libraries that Fink was complaining about, and after doing so was able to get the SVN client to build (all of the compiling probably took four or five hours).

In the meantime, I installed Eclipse, which was dirt simple. Download and extract the archive, then click on the icon. Everything seemed to work right out of the blocks. I’m a bit disappointed that Eclipse isn’t packaged in an OS X installer, and is currently living in my home directory. The OS X port of Vim was more cooperative. (Although, while I’m a diehard vim-head, I may have to go back to BBEdit or something because the ugly little Vim window looks out of place on a Mac. That never bothered me under Windows.)

When I went back to installing PHP, I found that there was some kind of weird dependency problem. I have autoconf 2.5x installed, and it’s complaining because it can’t remove that install version 2.1x instead. A few attempts to figure out what to do next failed, so I shelved that project temporarily.

I did manage to find the Ruby install on this machine, and run this fix because that seemed like the right thing to do. I then followed some of these instructions to get Rails installed. (I haven’t bothered with FastCGI yet, because WEBrick is fine for my use.)

The following morning: I’m still working on getting PHP installed. My current thought is that some instability was introduced when I switched Fink to use unstable packages and I didn’t update everything. I’m doing that now, and the compile is taking many hours. Judging from the progress bar, many hours still remain. When that’s complete, I’m going to give PHP another shot.

7 Comments

  1. Not sure who the clueful people where, but they gave you a couple of bum steers. First I love the Debian package system, but it is labor intensive, and Fink just doesn’t have sufficient community to make it work. (and its kind of weird, in un-apt ways) Use DarwinPorts

    2ndly, its more like Windows then like Linux when it comes to the big packages. You almost always want to grab the existing binaries for things like PHP and MySQL. Marc Liyanage is your friend.

    http://www.entropy.ch/software/macosx/php/

    MySQL now maintains its own (Marc derived as far as I can tell) OSX installer, use it:

    http://dev.mysql.com/downloads/mysql/4.1.html

    If you do want to use Apple’s built-in Apache/PHP config files are in /etc/httpd, DocumentRoot is “/Library/WebServer/Documents” (though I make a symlink from /var/www) and it can be started with /usr/sbin/apachectl or from System Preferences > Sharing

  2. And yeah, definitely don’t try to get FCGI working locally, it will break your heart.

  3. While perhaps not exactly what you’re looking for, do take a quick peek at Server Logistics’ “Complete” packages for OS X. They’ve got their own installers, and Apache & MySQL even come with System Preference panes for stopping/restarting the service and editing conf files. I’ve been using them for over a year locally, and swear by them. But my needs may not be as demanding as yours.

  4. Check out the free version of BBEdit (TextWrangler) before you lay out the money for the pay version. TextWrangler does a surprising number of things for a free program. I’m not a serious programmer, so I can’t say it has all the features you need, but it has a lot of programming features that my modest HTML-coding needs haven’t required me to explore.

  5. Fink can be unfun

    Installing Apache and PHP with Fink can be seriously un-fun, as Rafe Colburn, my new colleague at eXtension, discovered yesterday

    In fact, after

  6. I’ve been using NetBeans and Eclipse on Linux all summer. When the fall term started (last year I returned to university after 10 years away) I had to start working on my PowerBook so I could do my work outside of the office.

    Eclipse on Mac OS X on a PowerBook G4 1.33GHz with 1GB RAM is unacceptably slow IMHO. So what I’m doing now is running my Linux version of Eclipse on my PowerBook via X11. Much better.

  7. For Ruby on Rails I have found Locomotive to be amazingly simple. Try it… you’ll like it! 🙂

Leave a Reply

Your email address will not be published.

*

© 2024 rc3.org

Theme by Anders NorenUp ↑