Torkil Johnsen

My personal piece of cyberspace

Installing Phing on MAMP (Mac OSX)

Posted in osx, mac, joomla, mamp, phing, Web apps, pear, Php by tj on the April 6th, 2009

Just bumped into Phing, and thought I’d share my experiences. Installing Phing is easy enough. Phing is a build system in the shape of a PHP Pear package, that can do many things. To quote Hans Lillelid, this could include for instance configuring, packaging, uploading and testing. Ideal for building installable Joomla zip-files, which is what I am using it for right now.

This is how I set up Phing to run on my local MAMP-based webserver. MAMP = Apache, MySQL and PHP, on a Mac, much like WAMP and LAMP for Windows and Linux respectively.

These are just very brief instructions, specifically on how I did this on my own system. A complete documentation on Phing can be found on at phing.info. You don’t actually need MAMP either, it was just what I was working with to begin with.

Open the application Terminal. You can find pear by doing a locate call: locate pear.
Currently MAMP requires you to install it into /Applications, so you should find pear (for php5) here: /Applications/MAMP/bin/php5/bin/.
Make sure MAMP is using the correct php version, by starting MAMP and checking your preferences.

1: Go to the correct folder:
cd /Applications/MAMP/bin/php5/bin/

2: Make sure pear can locate the package:
./pear channel-discover pear.phing.info

3: Install phing:
./pear install phing/phing

Phing should now be installed. Run the command “ls -al” and you should see phing in the same folder as pear.

You can now run this command:
./phing -h
This will give you an overview of the phing’s options.

From here you can for instance just run:
./phing -f /path/to/your/build.xml

2 Responses to 'Installing Phing on MAMP (Mac OSX)'

Subscribe to comments with RSS or TrackBack to 'Installing Phing on MAMP (Mac OSX)'.

  1. sylvain pham said,

    on July 13th, 2009 at kl. 18.32

    For launch phing anywhere, i’m trying this

    create file :
    /Applications/MAMP/bin/setenvmamp.sh :
    add this :
    PATH=/Applications/MAMP/bin/php5/bin:$PATH export PATH

    in /Users/user/.profile
    add this
    test -r /Applications/MAMP/bin/setenvmamp.sh && . /Applications/MAMP/bin/setenvmamp.sh

    close Terminal and relaunch

  2. Peter Raeves said,

    on July 19th, 2009 at kl. 22.12

    Thank you for sharing your experiences.
    I’ve tried to do the same thing, including step 3: pear downloaded phing, but phing itself didn’t get installed.
    OS: 10.5.7
    MAMP: 1.7.2
    Could you give me a few pointers to troubleshoot (the manual on phing.info didn’t help me much).
    Thank you,
    Peter

Leave a Reply