Speak now
Please Wait Image Converting Into Text...
Embark on a journey of knowledge! Take the quiz and earn valuable credits.
Challenge yourself and boost your learning! Start the quiz now to earn credits.
Unlock your potential! Begin the quiz, answer questions, and accumulate credits along the way.
General Tech Bugs & Fixes 2 years ago
Posted on 16 Aug 2022, this text provides information on Bugs & Fixes related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.
Turn Your Knowledge into Earnings.
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 include "pcre.h" ^~~~~~~~
/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 :)
I was able to resolve this issue. Although php_pcre.h file was located in the include path, pcre.h wasn't.
I ran the install with the following command (setting the path for pcre header files) and that did the trick:
sudo C_INCLUDE_PATH=/usr/local/opt/pcre pecl install mongodb
Phew!
No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.
General Tech 9 Answers
General Tech 7 Answers
General Tech 3 Answers
General Tech 2 Answers
Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.