I am trying to install the MongoDB PHP Extension in my MacBook Pro M1. I am facing the following error during installation.
The command I am using for installation
sudo pecl install mongodb
Error
/private/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/pear/temp/mongodb/src/libmongoc/src/libmongoc/src/mongoc/mongoc-scram.c:85:10: fatal error: 'unicode/usprep.h' file not found
#include <unicode/usprep.h>
^~~~~~~~~~~~~~~~~~
1 error generated.
make: *** [src/libmongoc/src/libmongoc/src/mongoc/mongoc-scram.lo] Error 1
ERROR: `make' failed
Here is the output of which php and which pecl command
/Applications/XAMPP/bin//php
/Applications/XAMPP/bin//pecl
PHP version
PHP 8.1.4 (cli) (built: Mar 17 2022 03:15:01) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.4, Copyright (c) Zend Technologies
What I tried (getting same error)
- sudo /Applications/XAMPP/bin/pecl install mongodb
- sudo /Applications/XAMPP/xamppfiles/bin/pecl install mongodb
- tried this solution install mongodb extension for xampp on macos
- brew install icu4c
Mac version: Ventura 13.3.1 (a)