Home » Php » mongodb – io_stream.lo Error 1 when installing php extension

mongodb – io_stream.lo Error 1 when installing php extension

Posted by: admin July 12, 2020 Leave a comment

Questions:

I’m trying to install mongo php extension on OSX 10.11 but the command:

sudo pecl install mongo

gives the following error:

...
In file included from /private/tmp/pear/install/mongo/io_stream.c:34:
/private/tmp/pear/install/mongo/contrib/php-ssl.h:33:10: fatal error: 'openssl/evp.h' file not found
#include <openssl/evp.h>
         ^
1 error generated.
make: *** [io_stream.lo] Error 1
ERROR: `make' failed
How to&Answers:
  1. brew install openssl
  2. ln -s /usr/local/Cellar/openssl/1.0.2d_1/include/openssl /usr/local/include/openssl

Answer:

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 .

i.e. /usr/include/openssl points to Xcode library.

Build your mongo php library.

Once it is done, you should have to enable the rootless security protection:

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

Answer:

evp is high-level cryptographic functions.

Try to install development libraries:

Ubuntu: sudo apt-get install libssl-dev

CentOS: yum install openssl-devel

Source: Error while installing mongo driver for PHP on amazon linux

Answer:

I am using OS X and have a custom build of openssl in /usr/local/openssl

so:

ln -s /usr/local/openssl/include/openssl /usr/local/include/openssl

Answer:

The solution from Scott Wiersdorf seems to worked for me https://solitum.net/openssl-os-x-el-capitan-and-brew/

install opnessl through brew

brew install openssl

Link the openssl

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