setup mac os x (lion) as development machine ( macports: apache + mysql + php + subversion )

Here are the instructions to setup Mac OS X ( Lion ) for MAMP software development. Basically you will need apache, mysql, php, subversion and may be phpmyadmin. I am using macports which simplifies the installation process.

1. Install Xcode from apple’s Mac app store. It might take a while because mac app store is very slow/pathetic. ( so don’t blame your ISP )
In this time you can download other useful softwares. My recommendation:

IM: Adium
IRC: Colloguy,
Browser: Firefox (for development), Chrome (Browsing),
Flash Player
Skype
Textmate ( if don’t use vim or emacs )

2. Download macports from http://www.macports.org and follow the installation instructions.

3. Make sure port is updated to latest

sudo port selfupdate

4. Install the packages

sudo port install subversion apache2 mysql5-server php5 +pear +mysql5 php5-xdebug phpmyadmin git-core gitx

Similarly if you need any other software you can install it using macport. ( if it is available on macports )

5. Load ports so that services like apache and mysql start automatically event after restart.

sudo port load apache2
sudo port load mysql5

6. Go to your browser and type http://localhost  it should display “It works”. If not then you can manually start apache and mysql.

sudo /opt/local/share/mysql5/mysql/mysql.server start

sudo /opt/local/apache2/bin/httpd -k start

Now you are all set, time to develop some kool stuff 🙂

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.