Error installing MongoDb PHP driver with XAMPP on Max OS Lion

时光怂恿深爱的人放手 提交于 2019-12-05 21:42:40

It seems, that you did not install the xampp "Developer Package", required to build additional php extension. You can download the "Developer Package" from:

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

Mark Hillick

This has already been answered.

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

I followed the process outlined here http://akrabat.com/php/setting-up-php-mysql-on-os-x-10-7-lion/, referenced by the above Stackoverflow link and the process for install pear, followed by pecl and subsequently -

sudo pecl install mongo

works perfectly on OSX Lion.

You may need to modify the extensions in /etc/php.ini, however, this is explained in the output after you install the php mongo driver.

It took me the whole day to find this answer, I had tried everything, but this worked finally:

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

I found this article very helpful. Saved a lot of time after I wasted a lot of time to check other links. I did for MAMP and think will work for XAMPP too.

The thing is MAMP does not ship with all PHP sources to compile pecl mongo file and create mongo.so. All what you need is download php for respective version you are using. I was using php version 5.6.10. I checked php.net site that was having 5.6.13 version. I downloaded sources for this version from PhP.net. Executed "sudo pecl install mongo" again and it worked.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!