Using pecl to install the Mongodb driver on OS X El Capitan (v10.11.1)

社会主义新天地 提交于 2019-12-04 06:31:30
John J. Camilleri

I managed to get around this by installing OpenSSL using Homebrew (as suggested here):

$ brew install openssl
$ brew link openssl --force

Then

$ sudo pecl install mongodb

Do this

$ cd /usr/local/include 
$ ln -s ../opt/openssl/include/openssl

I recommend using http://phpbrew.github.io/phpbrew/ for this type of thing. It let's you easily install any extensions to any php version you require.

When installing a new version of php, I usually keep an eye on the log while it compiles. There might be dependencies that need installing first. Also, make sure you have an updated version of homebrew installed.

Alan Cruz

You need to disable the Mac OSX El Capitán rootless mechanism:

  1. Boot with Cmd-R
  2. Open Terminal
  3. Type csrutil disable
  4. Reboot

On the Mac, You need to install Xcode, and build the symlink for the openssl comes with Xcode, i.e.

cd /usr/include;
sudo ln -s /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-migrator/sdk/MacOSX.sdk/usr/include/openssl
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!