Error installing MongoDb PHP driver with XAMPP on Max OS Lion

I get this error when I try to run the following command sudo pecl install mongo

Error:

...php_mongo.c:22:10: fatal error: 'php.h' 
file not found 
  #include <php.h> 
         ^ 
  1 error generated. 
  make: *** [php_mongo.lo] Error 1 
  ERROR: `make' failed 

I am new to MAC, help me solve this problem and get Mongo working with PHP.

I installed MacPorts and autoconf

+3
source share
4 answers

It seems that you have not installed the "xampp" developer package, which is necessary to create an additional php extension. You can download the "Developer Package" from:

http://www.apachefriends.org/en/xampp-macosx.html#849

+10
source

This has already been answered.

Please follow the procedures in this answer - Install PECL on Mac OS X 10.6 .

, http://akrabat.com/php/setting-up-php-mysql-on-os-x-10-7-lion/, Stackoverflow , pecl -

sudo pecl install mongo

OSX Lion.

, /etc/php.ini, php mongo.

+3

, , , :

    sudo C_INCLUDE_PATH=/usr/local/opt/openssl/include /Applications/XAMPP/xamppfiles/bin/pecl install mongodb
+1

. , , . MAMP, , XAMPP.

The fact is that MAMP does not come with all PHP sources for compiling the pecl mongo file and creating mongo.so. All you need to do is download php for the appropriate version that you are using. I used the php version 5.6.10. I checked php.net site with version 5.6.13. I downloaded sources for this version from PhP.net . Done " sudo pecl install mongo" and it worked.

0
source

All Articles