Grayscale profile picture

Patrique Ouimet

Developer

COVID-19 Stats

Installing PHP and PECL Extensions on MacOS

Wed, Apr 3, 2019 9:47 PM

Install PHP with Homebrew

brew install php

Fixing broken directories

On a fresh MacOS installation I was getting an error:

Warning: mkdir(): File exists in System.php on line 294
PHP Warning:  mkdir(): File exists in /usr/local/Cellar/php/7.3.3/share/php/pear/System.php on line 294

Warning: mkdir(): File exists in /usr/local/Cellar/php/7.3.3/share/php/pear/System.php on line 294
ERROR: failed to mkdir /usr/local/Cellar/php/7.3.3/pecl/20180731

You simply need to make the directory the script cannot, to accomplish this, run the following:

pecl config-get ext_dir | pbcopy

mkdir -p {paste clipboard value}

Install PECL extensions

Now you can simple run pecl install {extension name}, here are some examples:

pecl install mailparse
pecl install imagick