使尝试在Centos 6上安装mongo php驱动程序失败 [英] make fails trying to install mongo php driver on Centos 6

查看:110
本文介绍了使尝试在Centos 6上安装mongo php驱动程序失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试了两种不同的方法来安装mongodb php驱动程序.

I've tried two different ways to install the mongodb php driver.

  • Compiling it based on directions from http://andres.jaimes.net/876/setup-mongo-php-module-centos-6/
  • Issuing (as root) pecl install mongo

服务器是Centos 6.6(32位),最初是6.5个virtualbox映像,(在更新之后)现在称为6.6

The server is Centos 6.6 (32-bit) that was originally a 6.5 virtualbox image that (following an update) now calls itself 6.6

错误似乎从这里开始:

In file included from /var/tmp/mongo/io_stream.c:34:
/var/tmp/mongo/contrib/php-ssl.h:33:25: error: openssl/evp.h: No such file or directory
/var/tmp/mongo/contrib/php-ssl.h:34:26: error: openssl/x509.h: No such file or directory
/var/tmp/mongo/contrib/php-ssl.h:35:28: error: openssl/x509v3.h: No such file or directory
In file included from /var/tmp/mongo/io_stream.c:34:
/var/tmp/mongo/contrib/php-ssl.h:38: error: expected ‘)’ before ‘*’ token
/var/tmp/mongo/contrib/php-ssl.h:39: error: expected ‘)’ before ‘*’ token
/var/tmp/mongo/contrib/php-ssl.h:40: error: expected ‘)’ before ‘*’ token
/var/tmp/mongo/io_stream.c: In function ‘php_mongo_io_stream_connect’:
/var/tmp/mongo/io_stream.c:189: error: ‘X509’ undeclared (first use in this function)
/var/tmp/mongo/io_stream.c:189: error: (Each undeclared identifier is reported only once
/var/tmp/mongo/io_stream.c:189: error: for each function it appears in.)
/var/tmp/mongo/io_stream.c:189: error: ‘cert’ undeclared (first use in this function)
/var/tmp/mongo/io_stream.c:194: error: expected expression before ‘)’ token
make: *** [io_stream.lo] Error 1
ERROR: `make' failed

-其他注意事项:

php -v
PHP 5.6.6 (cli) (built: Feb 19 2015 10:19:59)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies

mongo --version
MongoDB shell version: 2.6.8
openssl is installed 1.0.1e-30.e16_6_6.5.i686

我检查了其他(看似相关的)堆栈帖子,例如

I've checked other (seemingly related) Stack posts, such as MongoDB PHP driver can't installed Centos 6 cloud server - but it didn't seem to help or apply. Any ideas? Thanks.

推荐答案

好像没有为OpenSSL安装标头.

Looks like you don't have the headers installed for OpenSSL.

尝试yum install openssl-devel(如果不是root用户,则使用sudo),然后重新编译.

Try yum install openssl-devel (or use sudo if not root) then recompile.

这篇关于使尝试在Centos 6上安装mongo php驱动程序失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆