PEAR on macOS 11.0 Big Sur
31 Oct 2020macOS no longer ships with PEAR, but installing it is quite easy. Once that’s done PEAR and PECL work as expected (if you also want to set up and install Apache, PHP and MySQL, check this post).
Installing PEAR
cd /tmp
curl -s -O https://pear.php.net/install-pear-nozlib.phar
sudo php install-pear-nozlib.phar -d /usr/local/lib/php -b /usr/local/binIf that fails
autoconf may be missing. To install it just use Homebrew. Once Homebrew is installed, installing autoconf is as simple as:
brew install autoconfAfter 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 --ignore-errorsXcode 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 --installConfiguring PHP
Open /etc/php.ini and add .:/usr/local/lib/php/pear to include_path (if /etc/php.ini does not exist, create it with the following content).
include_path = ".:/usr/local/lib/php/pear"Any comments? Ping me on Twitter. 👉🏻 Get my newsletter for occasional updates. ✌🏻