macports

port install

SOFTWARE: macports

sudo port install php5 +apache2 +mysql5

Documentation

MacPorts Wiki

QuickStart Manual

Note about Path Variables

Make sure /opt/local/bin is in your path. Macports installer drops a file into your user directory called ".profile" that attempts to do this. If you have a file called ".bash_profile" it will also do this. Find out your path by typing "env" or "echo $PATH" in the shell. What you want in ".profile" is something like:

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

I might need to experiment with these settings for the crystal space setup...

Common Commands

Install a macport with the port command + arguments. IE:

sudo port install lynx

To update macports (including from darwinports to macports) just run:

sudo port selfupdate

Search for ports. IE search for php:

sudo port search php

Search for variants:

sudo port variants php5

Get info about a port:

sudo port info php5

Show what ports you have installed. This is handy if "which php" or similar isn't showing you stuff that lives in your macports "opt" directory:

sudo port installed

Upgrading and stuff

Let's say you want to install a newer version of automake so you do:

sudo port install automake

But it turns out you had an earlier version running on your system before and you get an error on activation. To deactivate a port with a specific version number so you can upgrade to a newer version disable the old one:

sudo port deactivate automake @1.9.6_0

Then, to upgrade your automake software:

sudo port upgrade automake

Or activate something explicitly with the activate command:

sudo port activate mysql5-devel

List all outdated ports that you currently have installed:

sudo port outdated

To find out what variants were designated for an installed port:

sudo port installed portname
MORE INFO: http://trac.macports.org/projects/macports
Comments