Installing pecl and pear on OS X 10.11 El Capitan, macOS 10.12 Sierra, macOS 10.13 High Sierra (< 10.13.3)

axlotl picture axlotl · Oct 1, 2015 · Viewed 70.1k times · Source

So it looks like the new 'System Integrity Protection' lockdown of /usr (among other directories) makes pear and pecl a non-starter. Has anyone found a workaround short of disabling it?

Answer

Paul Schreiber picture Paul Schreiber · Jan 22, 2016

There's a much easier way — no need to disable SIP or download your own copy:

sudo php /usr/lib/php/install-pear-nozlib.phar -d /usr/local/lib/php -b /usr/local/bin