title: Installing Phing & PHPUnit on MAMP
body: <p>I'm having problems running phpunit under MAMP on OS X 10.6.  I've installed phpunit via PEAR and it is exists in the MAMP directory but when I run phpunit in terminal nothing happens.  I'm guessing that this is a path problem but as a os x newbie, I don't know how to fix it.  This is what happens when I try to run it from /Applications/MAMP/bin/php5.3/bin</p>
  
  <pre><code>$ phpunit
  -bash: /usr/bin/phpunit: No such file or directory
  $ ./phpunit
  $
  </code></pre>
  
  <p>The problem looks very similar to this <a href="https://stackoverflow.com/questions/3930703/how-to-install-phpunit-3-5-on-mac-with-mamp">How to Install phpunit 3.5 on mac with MAMP</a> but the solutions there haven't worked so far. Here is some more system info:</p>
  
  <p>Location of phpunit in MAMP</p>
  
  <pre><code>$ sudo find / -name "phpunit"
  /Applications/MAMP/bin/php5.3/bin/phpunit
  /Applications/MAMP/bin/php5.3/lib/php/PEAR/phing/tasks/ext/phpunit
  find: /dev/fd/3: Not a directory
  find: /dev/fd/4: Not a directory
  </code></pre>
  
  <p>Possibly the problem here</p>
  
  <pre><code>$ which php
  /usr/bin/php
  $ which phpunit
  $ which pear
  $ which ./pear
  ./pear
  $ which ./phpunit
  ./phpunit
  </code></pre>
  
  <p>My php.ini from /Applications/MAMP/conf/php5.3/php.ini</p>
  
  <pre><code>include_path = ".:/Applications/MAMP/bin/php5.3/lib/php:/Applications/MAMP/bin/php5.3/lib/php/PEAR/"
  </code></pre>
  
  <p>The same issues happen when trying to run or access phing.</p>
  
  <p>So again, I'm guessing the problem is a path setting but I'm not sure how to fix this.</p>
  
  <p>Thanks</p>
  
  <p>Dave</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>thanks for your response.
  My pear is 1.9.2
  pear config show lists </p>
  
  <pre><code>$ ./pear config-show
  Configuration (channel pear.php.net):
  =====================================
  Auto-discover new Channels     auto_discover    &lt;not set&gt;
  Default Channel                default_channel  pear.php.net
  HTTP Proxy Server Address      http_proxy       &lt;not set&gt;
  PEAR server [DEPRECATED]       master_server    pear.php.net
  Default Channel Mirror         preferred_mirror pear.php.net
  Remote Configuration File      remote_config    &lt;not set&gt;
  PEAR executables directory     bin_dir          /Applications/MAMP/bin/php5.3/bin
  PEAR documentation directory   doc_dir          /Applications/MAMP/bin/php5.3/lib/php/doc
  PHP extension directory        ext_dir          /Applications/MAMP/bin/php5.3/lib/php/extensions
  PEAR directory                 php_dir          /Applications/MAMP/bin/php5.3/lib/php/PEAR
  PEAR Installer cache directory cache_dir        /tmp/pear/cache
  PEAR configuration file        cfg_dir          /Applications/MAMP/bin/php5.3/lib/php/cfg
  directory
  PEAR data directory            data_dir         /Applications/MAMP/bin/php5.3/lib/php/data
  PEAR Installer download        download_dir     /tmp/pear/cache
  directory
  PHP CLI/CGI binary             php_bin          /Applications/MAMP/bin/php5.3/bin/php
  php.ini location               php_ini          /Applications/MAMP/conf/php5.3/php.ini
  --program-prefix passed to     php_prefix       &lt;not set&gt;
  PHP's ./configure
  --program-suffix passed to     php_suffix       &lt;not set&gt;
  PHP's ./configure
  PEAR Installer temp directory  temp_dir         /tmp/pear/temp
  PEAR test directory            test_dir         /Applications/MAMP/bin/php5.3/lib/php/test
  PEAR www files directory       www_dir          /Applications/MAMP/bin/php5.3/lib/php/www
  Cache TimeToLive               cache_ttl        3600
  Preferred Package State        preferred_state  stable
  Unix file mask                 umask            22
  Debug Log Level                verbose          1
  PEAR password (for             password         &lt;not set&gt;
  maintainers)
  Signature Handling Program     sig_bin          /usr/local/bin/gpg
  Signature Key Directory        sig_keydir       /Applications/MAMP/conf/php5.3/pearkeys
  Signature Key Id               sig_keyid        &lt;not set&gt;
  Package Signature Type         sig_type         gpg
  PEAR username (for             username         &lt;not set&gt;
  maintainers)
  User Configuration File        Filename         /Users/dave/.pearrc
  System Configuration File      Filename         /Applications/MAMP/conf/php5.3/pear.conf'
  </code></pre>
  
  <p>ls -al of /Applications/MAMP/bin/php5.3/bin lists phpunit amongst others</p>
  
  <pre><code>-rwxr-xr-x   1 dave  admin       920  6 Apr 19:55 phing
  -r-xr-xr--@  1 dave  admin  57583340 16 Feb 16:08 php
  -rwxr-xr-x   1 dave  admin      2169  6 Apr 19:48 phpunit
  </code></pre>
  
  <p>As noted above, the php.ini seems to list the correct location and echo $PATH generates</p>
  
  <pre><code>$ echo $PATH
  /Applications/MAMP/bin/php5.3/bin:/Applications/MAMP/bin/php5.3/lib/php:/Applications/MAMP/bin/php5.3/lib/php/PEAR/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/X11/bin
  </code></pre>