所以我尝试使用sudo pecl install mongodb安装mongodb pecl扩展,并获取以下内容:
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
任何想法为什么这不起作用?
解决方法:
这个:
configure: error: Cannot find OpenSSL’s [evp.h]
您需要安装包含该标头的OpenSSL开发包(以及其他内容).
在dpkg可用的地方,它可用于确定任何给定文件的提供者:
$dpkg -S evp.h
libssl-dev:amd64: /usr/include/openssl/evp.h
因此,安装libssl-dev包将解决当前的问题.
您可能缺少其他类似的开发包,因此dpkg -S是一个有用的东西.
一般情况下,如果缺少某些标头或库,您可以使用后缀-dev来猜测需要安装的软件包的名称(如果这是发行版的惯例,则可以使用-devel).