title: How to set up PEAR on Mac OS X 10.5 Leopard
body: <p>I'm ultimately trying to install PEAR so I can easily install PHPUnit. I want to set up a Mac, Apache, MySQL, PHP, PHPUnit development environment so I can test locally. I already have Apach, MySQL and PHP working. Now all I need is PHPUnit, which means I need PEAR to install it.</p>
  
  <p>I have searched all over, and there are a few variations of "the tutorial" on how to install PEAR on Mac OS X 10.5. However, I can't seem to get any of them to work! Has anyone had success with this? I'm not totally confident that I have everything set up as it should be, so if you could include the "default" Mac OS X 10.5 include paths, or a simple explanation of where everything should go, I would appreciate it.</p>
  
  <p>Following <a href="http://clickontyler.com/blog/2008/01/how-to-install-pear-in-mac-os-x-leopard/" rel="noreferrer">this</a> tutorial I do the following:</p>
  
  <pre><code>curl http://pear.php.net/go-pear &gt; go-pear.php
  sudo php -q go-pear.php
  </code></pre>
  
  <p>I press enter until I get to a list with 7 include paths:</p>
  
  <pre><code>1. Installation prefix ($prefix) : /Users/andrew
  2. Temporary files directory     : $prefix/temp
  3. Binaries directory            : $prefix/bin
  4. PHP code directory ($php_dir) : $prefix/PEAR
  5. Documentation base directory  : $php_dir/docs
  6. Data base directory           : $php_dir/data
  7. Tests base directory          : $php_dir/tests
  </code></pre>
  
  <p>I change the <code>Installation prefix</code> to be <code>/usr/local</code>, press enter to continue, type <code>Y</code> to also install <code>PEAR_Frontend_Web-beta, PEAR_Frontend_Gtk2, MDB2</code>. Eventually, everything is installed.</p>
  
  <p>Next...</p>
  
  <p>On the first try, I think <code>include_path</code> was commented out of the php.ini file, but since I've already changed this line, and this is not the first time I've tried installing, I get the following message:</p>
  
  <pre><code>WARNING!  The include_path defined in the currently used php.ini does not
  contain the PEAR PHP directory you just specified:
  &lt;/usr/local/PEAR&gt;
  If the specified directory is also not in the include_path used by
  your scripts, you will have problems getting any PEAR packages working.
  
  Would you like to alter php.ini &lt;/private/etc/php.ini&gt;? [Y/n] : 
  </code></pre>
  
  <p>I type <code>Y</code> and let pear automatically update my include path:</p>
  
  <pre><code>php.ini &lt;/private/etc/php.ini&gt; include_path updated.
  
  Current include path           : .:/usr/share/pear
  Configured directory           : /usr/local/PEAR
  Currently used php.ini (guess) : /private/etc/php.ini
  </code></pre>
  
  <p>I press enter to continue, and get the following message:</p>
  
  <pre><code>The 'pear' command is now at your service at /usr/local/bin/pear
  
  ** The 'pear' command is not currently in your PATH, so you need to
  ** use '/usr/local/bin/pear' until you have added
  ** '/usr/local/bin' to your PATH environment variable.
  
  Run it without parameters to see the available actions, try 'pear list'
  to see what packages are installed, or 'pear help' for help.
  
  For more information about PEAR, see:
  
    http://pear.php.net/faq.php
    http://pear.php.net/manual/
  
  Thanks for using go-pear!
  
  PHP Warning:  rmdir(/usr/local/temp): Not a directory in /Users/andrew/go-pear.php on line 1237
  
  Warning: rmdir(/usr/local/temp): Not a directory in /Users/andrew/go-pear.php on line 1237
  </code></pre>
  
  <p><strong>Update:</strong> I think I know why these last two warnings came up. Previously, I tried to fix the temp directory problem by creating a symbolic link to /tmp but if I understand correctly, PEAR is trying to create its own temp directory for installation, then it's going to delete it when it's finished. So I should not have created this symbolic link since it's going to try to delete the temp directory when the installation has finished.</p>