0%

mac下php-mongodb扩展安装

/usr/local/src/mongodb-1.5.3/src/libmongoc/src/libmongoc/src/mongoc/mongoc-rand-common-crypto.c:25:10: fatal error:’Security/Security.h’ file not found.

一、步骤

  1. 下载wget http://pecl.php.net/get/mongodb-1.5.3.tgz
  2. 解压tar -zxvf mongodb-1.5.3.tgz
  3. cd mongodb-1.5.3
  4. /path/phpize
  5. ./configure –with-php-config=/path/php-config
  6. make && make install
    • 报错 /usr/local/src/mongodb-1.5.3/src/libmongoc/src/libmongoc/src/mongoc/mongoc-rand-common-crypto.c:25:10: fatal error:'Security/Security.h' file not found
  7. 解决
    • cd mongodb-1.5.3/include
    • ln -s /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Versions/A/Headers/ Security
    • ln -s /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Versions/A/Headers/ CoreFoundation
  8. make && make install

二、参考

  1. PECL