1

I am trying to install MongoDB PHP extension on macOS Catalina v10.15.7 by running the following command,

sudo pecl install mongodb

But it is throwing below error at the end,

Build process completed successfully
Installing '/usr/local/Cellar/php@7.4/7.4.13_1/pecl/20190902/mongodb.so'

Warning: mkdir(): File exists in System.php on line 294

Warning: mkdir(): File exists in /usr/local/Cellar/php@7.4/7.4.13_1/share/php@7.4/pear/System.php on line 294
ERROR: failed to mkdir /usr/local/Cellar/php@7.4/7.4.13_1/pecl/20190902

PHP location is — /usr/local/opt/php@7.4/bin/php

PECL location is — /usr/local/opt/php@7.4/bin/pecl

Thanks in advance.

1 Answers1

4

Applied below solution and it worked,

pecl config-get ext_dir | pbcopy

mkdir -p {paste clipboard value}

sudo pecl install mongodb