Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
PEAR on OS X Lion

After upgrading to OSX Lion, I discovered that both PEAR and PECL had gone missing. It turns out that you have to re-install them, but luckily it's quite simple. I found this quick guide from Ruggero De Pellegrini on Google+, and thought I would share the info to save you the confusion:

  1. Download the installer curl http://pear.php.net/go-pear.phar > go-pear.php
  2. Start the installation procedure with sudo sudo php -q go-pear.php
  3. Select a new installation base ($prefix) e.g. /usr/local
  4. Proceed with the install.
  5. If there is no /etc/php.ini file yet, copy the default sudo cp /etc/php.ini.default /etc/php.ini
  6. Edit /etc/php.ini and change the line ;include_path = ".:/php/includes" to include_path = ".:/usr/local/share/pear"
  7. Add /usr/local/bin/ to your path if you haven't already, e.g. in .profile

To test it, run either pecl or pear in Terminal.app and see if it works.

pdodd commented May 27, 2012

Thanks for posting - I found a few of these "pear on lion" walkthroughs, yours was the first one to work!

Owner

macek commented May 28, 2012

pdodd, I'm glad it could help you out. I originally found this doing some Googling myself. I copy/pasted it for personal records not even thinking that someone else would stumble across it someday. Take care :)

I love it when stuff works as advertised. Thanks for posting !

Thanks, it helped me too. The only difference is that because I use homebrew, I installed pear into /opt and then created a /opt/local/bin which I added to my profile and also created there symlinks to pear and pecl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment