0
 

When I installed the Mongo PHP extension, the following error occurred when I tried to compile the file.

  • PHP version is 7,
  • MongoDB version is 3.0.6.

The error

/bin/sh /root/mongo-1.6.0/libtool --mode=compile cc -I./util -I. -I/root/mongo-1.6.0 -DPHP_ATOM_INC -I/root/mongo-1.6.0/include -I/root/mongo-1.6.0/main -I/root/mongo-1.6.0 -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib -I/root/mongo-1.6.0/api -I/root/mongo-1.6.0/util -I/root/mongo-1.6.0/exceptions -I/root/mongo-1.6.0/gridfs -I/root/mongo-1.6.0/types -I/root/mongo-1.6.0/batch -I/root/mongo-1.6.0/contrib -I/root/mongo-1.6.0/mcon -I/root/mongo-1.6.0/mcon/contrib  -DHAVE_CONFIG_H  -g -O2   -c /root/mongo-1.6.0/php_mongo.c -o php_mongo.lo
mkdir .libs
cc -I./util -I. -I/root/mongo-1.6.0 -DPHP_ATOM_INC -I/root/mongo-1.6.0/include -I/root/mongo-1.6.0/main -I/root/mongo-1.6.0 -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib -I/root/mongo-1.6.0/api -I/root/mongo-1.6.0/util -I/root/mongo-1.6.0/exceptions -I/root/mongo-1.6.0/gridfs -I/root/mongo-1.6.0/types -I/root/mongo-1.6.0/batch -I/root/mongo-1.6.0/contrib -I/root/mongo-1.6.0/mcon -I/root/mongo-1.6.0/mcon/contrib -DHAVE_CONFIG_H -g -O2 -c /root/mongo-1.6.0/php_mongo.c -fPIC -DPIC -o .libs/php_mongo.o
In file included from/root/mongo-1.6.0/php_mongo.c:22:/root/mongo-1.6.0/php_mongo.h:197: error: expected ‘=’,‘,’,‘;’,‘asm’or‘__attribute__’ before ‘php_mongo_type_object_new’/root/mongo-1.6.0/php_mongo.h:201: error: expected ‘;’,‘,’or‘)’ before ‘*’ token
/root/mongo-1.6.0/php_mongo.h:207: error: expected ‘;’,‘,’or‘)’ before ‘*’ token
In file included from/root/mongo-1.6.0/php_mongo.c:24:/root/mongo-1.6.0/mongoclient.h:19: error: expected ‘=’,‘,’,‘;’,‘asm’or‘__attribute__’ before ‘php_mongoclient_new’In file included from/root/mongo-1.6.0/php_mongo.c:43:/root/mongo-1.6.0/types/id.h:19: error: expected declaration specifiers or‘...’ before ‘zend_uint’/root/mongo-1.6.0/types/id.h:20: error: expected declaration specifiers or‘...’ before ‘zend_uint’/root/mongo-1.6.0/php_mongo.c:Infunction‘OnUpdatePingInterval’:/root/mongo-1.6.0/php_mongo.c:127: error:‘new_value_length’ undeclared (first useinthisfunction)/root/mongo-1.6.0/php_mongo.c:127: error:(Each undeclared identifier is reported only once
/root/mongo-1.6.0/php_mongo.c:127: error:for each function it appears in.)/root/mongo-1.6.0/php_mongo.c:127: warning: passing argument 1 of ‘is_numeric_string’from incompatible pointer type
/usr/local/php/include/php/Zend/zend_operators.h:138: note: expected ‘constchar*’ but argument is of type ‘struct zend_string *’/root/mongo-1.6.0/php_mongo.c:Infunction‘OnUpdateIsMasterInterval’:/root/mongo-1.6.0/php_mongo.c:139: error:‘new_value_length’ undeclared (first useinthisfunction)/root/mongo-1.6.0/php_mongo.c:139: warning: passing argument 1 of ‘is_numeric_string’from incompatible pointer type
/usr/local/php/include/php/Zend/zend_operators.h:138: note: expected ‘constchar*’ but argument is of type ‘struct zend_string *’/root/mongo-1.6.0/php_mongo.c:Infunction‘zm_startup_mongo’:/root/mongo-1.6.0/php_mongo.c:236: error:‘mongo_read_property’ undeclared (first useinthisfunction)/root/mongo-1.6.0/php_mongo.c:237: error:‘mongo_write_property’ undeclared (first useinthisfunction)/root/mongo-1.6.0/php_mongo.c:At top level:/root/mongo-1.6.0/php_mongo.c:481: error: expected ‘=’,‘,’,‘;’,‘asm’or‘__attribute__’ before ‘php_mongo_type_object_new’/root/mongo-1.6.0/php_mongo.c:496:57: error: macro "zend_hash_get_current_data" passed 2 arguments, but takes just 1/root/mongo-1.6.0/php_mongo.c:Infunction‘get_tagset_from_array’:/root/mongo-1.6.0/php_mongo.c:496: error:‘zend_hash_get_current_data’ undeclared (first useinthisfunction)/root/mongo-1.6.0/php_mongo.c:505: warning: passing argument 2 of ‘zend_hash_get_current_key_ex’from incompatible pointer type
/usr/local/php/include/php/Zend/zend_hash.h:168: note: expected ‘struct zend_string **’ but argument is of type ‘char**’/root/mongo-1.6.0/php_mongo.c:505: warning: passing argument 3 of ‘zend_hash_get_current_key_ex’from incompatible pointer type
/usr/local/php/include/php/Zend/zend_hash.h:168: note: expected ‘zend_ulong *’ but argument is of type ‘uint*’/root/mongo-1.6.0/php_mongo.c:505: warning: passing argument 4 of ‘zend_hash_get_current_key_ex’from incompatible pointer type
/usr/local/php/include/php/Zend/zend_hash.h:168: note: expected ‘HashPosition*’ but argument is of type ‘ulong*’/root/mongo-1.6.0/php_mongo.c:505: error: too many arguments to function‘zend_hash_get_current_key_ex’/root/mongo-1.6.0/php_mongo.c:511: warning: passing argument 3 of ‘mongo_read_preference_add_tag’ makes pointer from integer without a cast
/root/mongo-1.6.0/mcon/read_preference.h:51: note: expected ‘char*’ but argument is of type ‘int’/root/mongo-1.6.0/php_mongo.c:553:47: error: macro "add_assoc_string" passed 4 arguments, but takes just 3/root/mongo-1.6.0/php_mongo.c:Infunction‘php_mongo_make_tagsets’:/root/mongo-1.6.0/php_mongo.c:553: error:‘add_assoc_string’ undeclared (first useinthisfunction)/root/mongo-1.6.0/php_mongo.c:587:61: error: macro "zend_hash_get_current_data" passed 2 arguments, but takes just 1/root/mongo-1.6.0/php_mongo.c:Infunction‘php_mongo_use_tagsets’:/root/mongo-1.6.0/php_mongo.c:587: error:‘zend_hash_get_current_data’ undeclared (first useinthisfunction)/root/mongo-1.6.0/php_mongo.c:Infunction‘php_mongo_trigger_error_on_command_failure’:/root/mongo-1.6.0/php_mongo.c:658: warning: passing argument 2 of ‘zend_hash_find’from incompatible pointer type
/usr/local/php/include/php/Zend/zend_hash.h:154: note: expected ‘struct zend_string *’ but argument is of type ‘char*’/root/mongo-1.6.0/php_mongo.c:658: error: too many arguments to function‘zend_hash_find’/root/mongo-1.6.0/php_mongo.c:664: warning: passing argument 2 of ‘zend_hash_find’from incompatible pointer type
/usr/local/php/include/php/Zend/zend_hash.h:154: note: expected ‘struct zend_string *’ but argument is of type ‘char*’/root/mongo-1.6.0/php_mongo.c:664: error: too many arguments to function‘zend_hash_find’/root/mongo-1.6.0/php_mongo.c:665: warning: passing argument 1 of ‘zval_get_type’from incompatible pointer type
/usr/local/php/include/php/Zend/zend_types.h:326: note: expected ‘conststruct zval *’ but argument is of type ‘struct zval **’/root/mongo-1.6.0/php_mongo.c:665: warning: passing argument 1 of ‘zval_get_type’from incompatible pointer type
/usr/local/php/include/php/Zend/zend_types.h:326: note: expected ‘conststruct zval *’ but argument is of type ‘struct zval **’/root/mongo-1.6.0/php_mongo.c:665: warning: passing argument 1 of ‘_convert_to_string’from incompatible pointer type
/usr/local/php/include/php/Zend/zend_operators.h:243: note: expected ‘struct zval *’ but argument is of type ‘struct zval **’/root/mongo-1.6.0/php_mongo.c:666: warning: assignment makes pointer from integer without a cast
/root/mongo-1.6.0/php_mongo.c:671: warning: passing argument 2 of ‘zend_hash_find’from incompatible pointer type
/usr/local/php/include/php/Zend/zend_hash.h:154: note: expected ‘struct zend_string *’ but argument is of type ‘char*’/root/mongo-1.6.0/php_mongo.c:671: error: too many arguments to function‘zend_hash_find’/root/mongo-1.6.0/php_mongo.c:672: warning: passing argument 1 of ‘zval_get_type’from incompatible pointer type
/usr/local/php/include/php/Zend/zend_types.h:326: note: expected ‘conststruct zval *’ but argument is of type ‘struct zval **’/root/mongo-1.6.0/php_mongo.c:672: warning: passing argument 1 of ‘convert_to_long’from incompatible pointer type
/usr/local/php/include/php/Zend/zend_operators.h:244: note: expected ‘struct zval *’ but argument is of type ‘struct zval **’/root/mongo-1.6.0/php_mongo.c:685: error: too many arguments to function‘zend_hash_copy’/root/mongo-1.6.0/php_mongo.c:687: warning: passing argument 1 of ‘_zval_ptr_dtor’from incompatible pointer type
/usr/local/php/include/php/Zend/zend_variables.h:112: note: expected ‘struct zval *’ but argument is of type ‘struct zval **’/root/mongo-1.6.0/php_mongo.c:Infunction‘php_mongo_trigger_error_on_gle’:/root/mongo-1.6.0/php_mongo.c:708: warning: passing argument 2 of ‘zend_hash_find’from incompatible pointer type
/usr/local/php/include/php/Zend/zend_hash.h:154: note: expected ‘struct zend_string *’ but argument is of type ‘char*’/root/mongo-1.6.0/php_mongo.c:708: error: too many arguments to function‘zend_hash_find’/root/mongo-1.6.0/php_mongo.c:716: warning: passing argument 2 of ‘zend_hash_find’from incompatible pointer type
/usr/local/php/include/php/Zend/zend_hash.h:154: note: expected ‘struct zend_string *’ but argument is of type ‘char*’/root/mongo-1.6.0/php_mongo.c:716: error: too many arguments to function‘zend_hash_find’/root/mongo-1.6.0/php_mongo.c:717: warning: passing argument 1 of ‘zval_get_type’from incompatible pointer type
/usr/local/php/include/php/Zend/zend_types.h:326: note: expected ‘conststruct zval *’ but argument is of type ‘struct zval **’/root/mongo-1.6.0/php_mongo.c:717: warning: passing argument 1 of ‘convert_to_long’from incompatible pointer type
/usr/local/php/include/php/Zend/zend_operators.h:244: note: expected ‘struct zval *’ but argument is of type ‘struct zval **’/root/mongo-1.6.0/php_mongo.c:724: warning: passing argument 2 of ‘zend_hash_find’from incompatible pointer type
/usr/local/php/include/php/Zend/zend_hash.h:154: note: expected ‘struct zend_string *’ but argument is of type ‘char*’/root/mongo-1.6.0/php_mongo.c:724: error: too many arguments to function‘zend_hash_find’/root/mongo-1.6.0/php_mongo.c:736: error: too many arguments to function‘zend_hash_copy’/root/mongo-1.6.0/php_mongo.c:738: warning: passing argument 1 of ‘_zval_ptr_dtor’from incompatible pointer type
/usr/local/php/include/php/Zend/zend_variables.h:112: note: expected ‘struct zval *’ but argument is of type ‘struct zval **’
make:***[php_mongo.lo]Error1
1

The first time to answer questions

If you are a Linux user the following answers may help you

I had the same problem with you, but I got it

In fact, we should use mongodb instead of using Mongo

These two are different

This is my installation hope to help you

curl -O https://pecl.php.net/get/mongodb-1.2.3.tgz

tar zxf mongodb-1.2.3.tgz

cd mongodb-1.2.3

phpize

./configure --with-php-config=php-config 

make&&make install

Some links

https://docs.mongodb.com/ecosystem/drivers/php/

 
 
https://stackoverflow.com/questions/40144519/make-php-mongo-lo-error-1

mongo扩展错误的更多相关文章

  1. Mac php7本地安装mongodb扩展以适配使用mongo扩展的线上老代码

    从https://pecl.php.net/package/mongodb官网下载压缩包(不懂事的我下载了1.5.1版本) 解压安装包 tar -zxvf mongodb-1.5.1.tgz 进入解压 ...

  2. Mongo运行错误:Failed to connect 127.0.0.1:27017,reason:errno:10061由于目标计算机积极拒绝,无法连接

    Mongo运行错误:如下 原因是mongodb的服务没有开启,开启服务后问题就能解决了,开启服务命令:mongod --dbpath "d:\mongodb\data 只要操作mongodb ...

  3. 1.MongoDB报错 Failed to connect 127.0.0.1:27017 Mongo运行错误

    1.Mongo运行错误:Failed to connect 127.0.0.1:27017 Mongo运行错误:Failed to connect 127.0.0.1:27017,reason:err ...

  4. php动态安装mongo扩展

    首先下载mongo扩展包  http://pecl.php.net/package/mongo 开始安装把 wget http://pecl.php.net/get/mongo-1.5.8.tgz t ...

  5. mongo 1067错误

    对mongo进行错误的操作导致mongo服务异常关闭,当重启mongo服务时出现1067错误此时在data目录下产生mongod.lock文件,可以讲此文件删除,然后重启就可以了 Please mak ...

  6. yum安装memcache,mongo扩展以及python的mysql模块安装

    //启动memcached/usr/local/memcached/bin/memcached -d -c 10240 -m 1024 -p 11211 -u root/usr/local/memca ...

  7. centos7.5环境下编译安装php7.0.30并安装redis和mongo扩展

    .安装php7..30的脚本 # vim install_php.sh #!/bin/bash # 安装基本依赖 yum install -y gcc gcc-c++ htop telnet ioto ...

  8. 开启mongod服务(Mongo运行错误:Failed to connect 127.0.0.1:27017,reason:errno:10061由于目标计算机积极拒绝,无法连接)

    问题:Mongo运行错误:Failed to connect 127.0.0.1:27017,reason:errno:10061由于目标计算机积极拒绝,无法连接 在Mongodb的安装过程中碰到的问 ...

  9. ubuntu下安装mongo扩展

    安装openssl apt-get install openssl libssl-dev libssl0.9.8 libgtk2.0-dev 安装php-pear apt-get install ph ...

随机推荐

  1. 关于RBAC(Role-Base Access Control)的理解(转)

    基于角色的访问控制(Role-Base Access Control) 有两种正在实践中使用的RBAC访问控制方式:隐式(模糊)的方式和显示(明确)的方式. 今天依旧有大量的软件应用是使用隐式的访问控 ...

  2. MetaMask/metamask-inpage-provider

    https://github.com/MetaMask/metamask-inpage-provider Used to initialize the inpage ethereum provider ...

  3. k8s搭建问题(1)--OOMKilled

    kubectl describe pods ****** --namespace=****** 现象 Host Port: /TCP State: Waiting Reason: CrashLoopB ...

  4. B轮公司技术问题列表(转)

    1.异构系统的接口对接我们有自己的一套统一接口,但是需要与其它公司的接口做对接,但是各个公司的接口各不相同,有什么好的方式能够方便与各公司的接口做对接的同时我们这边也能尽量少或者不需要改动代码就能实现 ...

  5. Ubuntu16.04下安装配置phpmyadmin

    在项目配置了阿里的druid,可以监控session,spring和详细sql的执行情况以及具体到表等信息,但是仍然发现不够详细,而且作为一个半吊子dba,一直用linux命令分配权限和管理数据库,效 ...

  6. nightwatch-前端自动化测试工具安装

    最近再弄这个前端自动化测试工具,刚开始弄了几天,目前为止遇到很多坑,光是安装就费了不少时间,记录一下,以便自己忘记. 这里是它的官网,目前没找到中文版的官网,全英文,对我这个英语渣来说有点难理解. 一 ...

  7. B-Tree外存数据结构 _(外存储器—磁盘)第一部分

    1.外存储器—磁盘 计算机存储设备一般分为两种:内存储器(main memory)和外存储器(external memory).内存存取速度快,但容量小,价格昂贵,而且不能长期保存数据(在不通电情况下 ...

  8. java中的SHA单向加密

    SHA全名叫做安全散列算法,是FIPS所认证的安全散列算法.能计算出一个数字消息所对应到的,长度固定的字符串(又称消息摘要)的算法.且若输入的消息不同,它们对应到不同字符串的机率很高. package ...

  9. Maven-SSM项目pom.xml配置以及springmvc配置以及mybatis配置及web.xml配置

    一.Maven本地仓库的pom.xml配置 (全部是mysql数据库) <project xmlns="http://maven.apache.org/POM/4.0.0" ...

  10. React-使用redux-immutable统一数据格式

    在header的reducer.js里把header变成immutable对象之后,在组件里获取focused属性就得这样获取: focused:state.header.get('focused') ...