Bill Garrison Bill Garrison - 4 months ago 31
PHP Question

mongodb php extension install giving configuration error

So I am trying to install the mongodb pecl extension using

sudo pecl install mongodb
and get the following:

downloading mongodb-1.1.2.tgz ...
Starting to download mongodb-1.1.2.tgz (642,582 bytes)
....done: 642,582 bytes
349 source files, building
running: phpize
Configuring for:
PHP Api Version: 20151012
Zend Module Api No: 20151012
Zend Extension Api No: 320151012
building in /var/tmp/pear-build-rootGfSZhI/mongodb-1.1.2
running: /var/tmp/mongodb/configure --with-php-config=/usr/bin/php-config
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib
checking for PHP extension directory... /usr/lib64/php/modules
checking for PHP installed headers prefix... /usr/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... re2c
checking for re2c version... 0.13.5 (ok)
checking for gawk... gawk
checking whether to enable mongodb support... yes, shared
checking OpenSSL dir for mongodb... yes
checking PHP version... 70000
checking whether to enable developer build flags... no
checking whether to enable code coverage... no
checking whether to use system libbson... no
checking configuring libmongoc... ...
checking whether to use system libmongoc... no
checking for pkg-config... /usr/bin/pkg-config
configure: error: Cannot find OpenSSL's <evp.h>
ERROR: `/var/tmp/mongodb/configure --with-php-config=/usr/bin/php-config' failed

Any ideas why this isn't working?



configure: error: Cannot find OpenSSL's [evp.h]

You need to install OpenSSL development package which contains that header (amongst other things).

Where dpkg is avilable, it can be used to determine the provider of any given file:

$ dpkg -S evp.h
libssl-dev:amd64: /usr/include/openssl/evp.h

So that installing the libssl-dev package will solve the current problem.

You may be missing other similar development packages, so dpkg -S is a useful thing to know about.

Many package managers have similar functionality, for example yum provides.

In general though, if some header or library is missing you can have a guess at the name of the package you need to install by using the suffix -dev (or -devel if that's the convention for your distro).