Installing PEAR on Mac OS X 10.5 Leopard

PEAR was removed by Apple from 10.5 for one reason or another. Here’s how to get it back:

Pre-requisties

Make sure you have a php.ini file in /etc/. This isn’t available by default. To create one enter the following:

sudo cp /etc/php.ini.default /etc/php.ini

PEAR Install

  • cd
  • curl -O http://pear.php.net/go-pear
  • sudo php go-pear

This starts the interactive install script.

  • Press Enter to start install
  • Press Enter to use no HTTP proxy
  • Type 1 and press Enter
  • Enter /usr/local/pear as the path and press Enter
  • Press Enter to confirm the install directories
  • Press Enter to install PEAR_Frontend_Web-beta,
    PEAR_Frontend_Gtk2, MDB2 by default

The installer will also alter the include_path in your php.ini file to include the new installation directory, so just press Enter when prompted

The PEAR Package Manager

To make using the command line tool easier, we are going to modify our shell path. Add the following line to the end of your ~/.profile file:

export PATH="$PATH:/usr/local/pear/bin"

After saving your .profile file, log into a new terminal and type the following to confirm that everything is working

pear version

If all is well, you should see the following output (or similar):

PEAR Version: 1.7.2
PHP Version: 5.2.5
Zend Engine Version: 2.2.0
Running on: Darwin glen-scotts-macbook.local 9.3.0 Darwin Kernel Version 9.3.0: Fri May 23 00:49:16 PDT 2008; root:xnu-1228.5.18~1/RELEASE_I386 i386

For more information on using the manager to install and maintain packages, see the PEAR manual for the command line installer.

Clean up

rm go-pear

Glen Scott

I’m a freelance software developer with 18 years’ professional experience in web development. I specialise in creating tailor-made, web-based systems that can help your business run like clockwork. I am the Managing Director of Yellow Square Development.

More Posts

Follow Me:
TwitterFacebookLinkedIn

Leave a Reply

Your email address will not be published. Required fields are marked *

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