Skip to content

Instantly share code, notes, and snippets.

@DominikTo
Last active December 21, 2015 03:29
Show Gist options
  • Save DominikTo/6242741 to your computer and use it in GitHub Desktop.
Save DominikTo/6242741 to your computer and use it in GitHub Desktop.
PEAR on OS X 10.9 Mavericks

Like previous versions of OS X, 10.9 also ships with PEAR. To install and activate it, a few steps are necessary. After that PEAR and PECL work as expected (if you also want to set up and install Apache, PHP and MySQL, check this Gist.

Installing PEAR:

cd /usr/lib/php
sudo php install-pear-nozlib.phar

If that fails

autoconf may be missing. To install it just use Homebrew. Once Homebrew is installed, installing autoconf is as simple as:

brew install autoconf

After autoconf is installed, try running the pear installer above again.

Upgrade PEAR

sudo pear channel-update pear.php.net
sudo pecl channel-update pecl.php.net
sudo pear upgrade-all

Xcode Command Line Developer Tools

You will run into problems installing pecl extensions, if you don't have the Xcode Command Line Extensions installed, so we'll also install them.

xcode-select --install

Configuring PHP

Open /etc/php.ini and add ".:/usr/lib/php/pear" to include_path (if /etc/php.ini does not exist, create it with the following contents).

include_path = ".:/usr/lib/php/pear"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment