I am having some issues installing mongodb driver for PHP on MacOS. The PHP I have on my laptop came with MacOS and the version is:
PHP 7.1.19 (cli) (built: Aug 17 2018 20:10:18) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
I have followed instructions on disabling csrutil and installed pear with the following command:
curl -O http://pear.php.net/go-pear.phar sudo php -d detect_unicode=0 go-pear.phar
And then I am trying to install mongodb with the following command:
sudo pecl install mongodb
The problem now is that the compilation fails with "include file not found" error. I have Xcode development and command line tools installed and have looked all over for answers but I can't seem to crack this error.
While installing the include paths are found by pecl (as shown below) but when it comes to compiling it is erroring out as below:
/usr/include/php/ext/pcre/php_pcre.h:29:10: fatal error: 'pcre.h' file not found
Following a suggestion on the web I even included the path to header files with C_INCLUDE_PATH but doesn't work.
checking for PHP includes... -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib checking for PHP extension directory... /usr/lib/php/extensions/no-debug-non-zts-20160303 checking for PHP installed headers prefix... /usr/include/php
Can someone please throw some light on this? I am at my wit's end on this :)