Dev environment on OSX

I feel like I’m behind at work recently so I didn’t want to start the new year at the office spending time configuring the new notebook. The baby was nice to me tonight and went to bed early so it allowed me to have the chance to get my development environment on the new Macbook Pro with OSX Tiger configured. Thanks to M in Ohio who saved me hours of time by pointing me to the right solution.

The nice thing about the OSX is that it is build on top of UNIX which is a developer’s OS. You’ll find that most open source tools are available and if not then getting it compiled from source is usually possible. I used compile everything from source including the kernel, but now that I am a lazy old man, I tend to prefer using some sort of package management solution that has the dependencies resolved. For Linux, I like the yum package management tool that sits on top of RPM. It beats the hell out of downloading the source and figuring out all the dependencies.

M pointed me to MacPorts as a similar repository/package management solution for OSX open source packages. It’s really easy to use. Simply download the install package from the site, run it and you’re ready to go. I did ran into one bug where it didn’t create a .profile file for me so the path to “port” couldn’t be found. I’m not sure why, but a quick look on the site and I knew which directories to add to my $PATH variable.

export PATH=/opt/local/bin:/opt/local/sbin:$PATH

Don’t forget to “source ~/.profile” to pick up the change.

With MacPorts installed, it was only a matter of grabbing the programs I needed for a web development environment: Apache2, MySQL, PostgreSQL, PHP5.

Installing Apache2:

If you want to automatically start apache at boot-up then do then:

sudo launchctl load -w /Library/LaunchDaemons/org.macports.apache2.plist

Installing MySQL and PostgreSQL:

Installing PHP5 with support for MySQL, PostgreSQL:

sudo /opt/local/apache2/bin/apachectl start

Installing Eclipse IDE:

With that, the an Unix development environment capable of doing web development with PHP, MySQL and/or PostgreSQL as well as Java/C/C++ development is all ready!

For a little more detail about the set up process, I stumbled on this nice post.

LazyHacker avatar
About LazyHacker
Just a boring guy.