How to install PHPUnit with MAMP
1 August 2010 | Posted by Jeffrey Barke | No comments
Installing PHPUnit with MAMP’s PEAR installer is pretty straightforward, but there are a few things to note:
- Everything will be done through Terminal, so go ahead and launch it now. All of the commands I give can be copied and pasted as they are.
- Make sure you’re using the version of PEAR that came with MAMP, not the version that came with your Mac. This means we have to use
/Applications/MAMP/bin/php5/bin/pearat the prompt, notpear. - PHPUnit 3.4 requires PHP 5.1.4 or later, but PHP 5.3.2 or later is recommended. MAMP 1.8.2 (the version I have installed) is running version 5.2.10. The latest version of MAMP includes version 5.3.2. So far, I haven’t noticed any problems running PHPUnit under 5.2.10.
- PHPUnit also requires PEAR 1.8.1. MAMP 1.8.2 ships with version 1.8.0. To check which version you have installed, type
/Applications/MAMP/bin/php5/bin/pear -V.
If you need to upgrade PEAR, first use the following two commands:/Applications/MAMP/bin/php5/bin/pear channel-update pear.php.net/Applications/MAMP/bin/php5/bin/pear upgrade pear
Now, it’s time to install PHPUnit. The PEAR channel used to distribute PHPUnit needs to be registered with the local PEAR environment, and a component that PHPUnit depends upon is hosted on the Symfony Components PEAR channel. To register the channels and install, simply type:/Applications/MAMP/bin/php5/bin/pear channel-discover pear.phpunit.de/Applications/MAMP/bin/php5/bin/pear channel-discover pear.symfony-project.com/Applications/MAMP/bin/php5/bin/pear install phpunit/PHPUnit
PHPUnit is now installed, but to get it to run from Terminal, we need to move it into our $PATH. To do so, type:
mv /Applications/MAMP/bin/php5/bin/phpunit /usr/local/bin/phpunit.
To test your install, type:phpunit --version.
You should see something like PHPUnit 3.4.15 by Sebastian Bergmann. And that's it!
How to make MAMP recognize the .shtml extension and read server side includes
8 April 2010 | Posted by Jeffrey Barke | 2 comments
- Stop MAMP (
/Applications/MAMP/MAMP.app) - Open MAMP's httpd.conf in a plain text editor (
/Applications/MAMP/conf/apache/httpd.conf). - Find the line
DirectoryIndex index.html index.php
and change toDirectoryIndex index.shtml index.html index.php - Uncomment the following two lines:
AddType text/html .shtmlAddOutputFilter INCLUDES .shtml - Find the lines
<Directory />Options Indexes FollowSymLinksAllowOverride All</Directory>
and change to<Directory />Options Indexes FollowSymLinksOptions +IncludesAllowOverride All</Directory> - Restart MAMP
Firebug extensions
9 July 2008 | Posted by Jeffrey Barke | No comments
As Jan Odvarko notes, "I was surprised how many Firebug extensions … exist out there." Check out his list of 12 extensions at http://www.softwareishard.com/blog/firebug/list-of-firebug-extensions/. All extensions include a brief summary of what they do, a screen capture and a link to the download page.
Two that I use are YSlow and Odvarko's own Firecookie.. YSlow analyzes Web pages and determines why they're slow based on Yahoo's rules for high performance web sites. Firecookie makes it possible to view and manage cookies within the familiar Firebug UI.

