Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

349
Views
sudo pecl install mongodb problem | unknown type name 'pcre_cache_entry'

I'm trying to install mongodb exentsion for php 8.0.13 on my MacOS Monterey.

I try sudo pecl install mongodb command: and then get below errror.

/opt/homebrew/Cellar/php@8.0/8.0.13/include/php/ext/spl/spl_iterators.h:151:4: error: unknown type name 'pcre_cache_entry'
                    pcre_cache_entry *pce;
                    ^
1 error generated.
make: *** [php_phongo.lo] Error 1
ERROR: `make' failed

enter image description here

which php: /opt/homebrew/bin/php php -v: PHP 8.0.13 (cli) (built: Nov 28 2021 13:11:14) ( NTS ) Copyright (c) The PHP Group Zend Engine v4.0.13, Copyright (c) Zend Technologies with Zend OPcache v8.0.13, Copyright (c), by Zend Technologies

Can anyone help me for fix this error? Thanks for your attention!

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

To compile MongoDB using PECL you will have to copy the pcre2.h to php's include directory.

For php@8.0, you can do this, But you will have to do this after every PHP release or if you switch the PHP version.

pcre2_h="$(find "$(brew --cellar pcre2)" -name "pcre2.h")"
cp -f "$pcre2_h" "$(brew --cellar php@8.0)"/*/include/php/ext/pcre

To avoid this I would recommend using shivammathur/extensions brew tap for installing PHP extensions.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!