-1

I am trying to install the MongoDB PHP Extension in my new MacBook Air M1. I am facing the following error during installation

The command I am using for installation

sudo pecl install mongodb

The error I am facing

/opt/homebrew/Cellar/php/8.0.9/include/php/ext/pcre/php_pcre.h:23:10: fatal error: 'pcre2.h' file not found
#include "pcre2.h"
         ^~~~~~~~~
1 error generated.
make: *** [php_phongo.lo] Error 1
ERROR: `make' failed

Here is the output of which php and which pecl command

aniketmagadum@Anikets-MacBook-Air bin % which php
/opt/homebrew/bin/php
aniketmagadum@Anikets-MacBook-Air bin % which pecl
/opt/homebrew/bin/pecl

The PHP Version I am using

aniketmagadum@Anikets-MacBook-Air bin % php -v
PHP 8.0.9 (cli) (built: Jul 29 2021 08:52:24) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.9, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.9, Copyright (c), by Zend Technologies
aniketmagadum@Anikets-MacBook-Air bin % 
Aniket
  • 156
  • 13

1 Answers1

0

Looks like you need to brew install pcre or get it on your system some other way.

hd1
  • 33,938
  • 5
  • 80
  • 91