dongtan1009 2016-10-20 02:40
浏览 361

make:*** [php_mongo.lo]错误1

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

This is a picture

  • 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: In function ‘OnUpdatePingInterval’:
/root/mongo-1.6.0/php_mongo.c:127: error: ‘new_value_length’ undeclared (first use in this function)
/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 ‘const char *’ but argument is of type ‘struct zend_string *’
/root/mongo-1.6.0/php_mongo.c: In function ‘OnUpdateIsMasterInterval’:
/root/mongo-1.6.0/php_mongo.c:139: error: ‘new_value_length’ undeclared (first use in this function)
/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 ‘const char *’ but argument is of type ‘struct zend_string *’
/root/mongo-1.6.0/php_mongo.c: In function ‘zm_startup_mongo’:
/root/mongo-1.6.0/php_mongo.c:236: error: ‘mongo_read_property’ undeclared (first use in this function)
/root/mongo-1.6.0/php_mongo.c:237: error: ‘mongo_write_property’ undeclared (first use in this function)
/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: In function ‘get_tagset_from_array’:
/root/mongo-1.6.0/php_mongo.c:496: error: ‘zend_hash_get_current_data’ undeclared (first use in this function)
/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: In function ‘php_mongo_make_tagsets’:
/root/mongo-1.6.0/php_mongo.c:553: error: ‘add_assoc_string’ undeclared (first use in this function)
/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: In function ‘php_mongo_use_tagsets’:
/root/mongo-1.6.0/php_mongo.c:587: error: ‘zend_hash_get_current_data’ undeclared (first use in this function)
/root/mongo-1.6.0/php_mongo.c: In function ‘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 ‘const struct 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 ‘const struct 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 ‘const struct 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: In function ‘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 ‘const struct 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] Error 1
  • 写回答

1条回答 默认 最新

  • dongquqiao2010 2017-01-20 09:15
    关注

    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/

    评论

报告相同问题?

悬赏问题

  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 LiBeAs的带隙等于0.997eV,计算阴离子的N和P
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 来真人,不要ai!matlab有关常微分方程的问题求解决,
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算