发表回复 
 
主题评价:
  • 0 次(票) - 平均星级: 0
  • 1
  • 2
  • 3
  • 4
  • 5
中文分词失败,怎么办?
2015年12月20日, 02:49
中文分词失败,怎么办?
安装环境:CentOS6.5,LNMPA,PHP7.0.1,REDIS,
安装状态:前边安装都正常了。现在分词安装也完成,/usr/local/scws/bin/scws -h也正常,词典下载也正常。最后进入PHP扩展,进入最后make时,出错了,详细错误附后,请问怎么办?



[root@localhost phpext]# make
/bin/sh /root/scws-1.2.2/phpext/libtool --mode=compile cc -I. -I/root/scws-1.2.2/phpext -DPHP_ATOM_INC -I/root/scws-1.2.2/phpext/include -I/root/scws-1.2.2/phpext/main -I/root/scws-1.2.2/phpext -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/usr/local/scws/include/scws -DHAVE_CONFIG_H -g -O2 -c /root/scws-1.2.2/phpext/php_scws.c -o php_scws.lo
cc -I. -I/root/scws-1.2.2/phpext -DPHP_ATOM_INC -I/root/scws-1.2.2/phpext/include -I/root/scws-1.2.2/phpext/main -I/root/scws-1.2.2/phpext -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/usr/local/scws/include/scws -DHAVE_CONFIG_H -g -O2 -c /root/scws-1.2.2/phpext/php_scws.c -fPIC -DPIC -o .libs/php_scws.o
/root/scws-1.2.2/phpext/php_scws.c: In function ‘php_scws_dtor’:
/root/scws-1.2.2/phpext/php_scws.c:145: error: ‘rsrc’ undeclared (first use in this function)
/root/scws-1.2.2/phpext/php_scws.c:145: error: (Each undeclared identifier is reported only once
/root/scws-1.2.2/phpext/php_scws.c:145: error: for each function it appears in.)
/root/scws-1.2.2/phpext/php_scws.c: In function ‘zif_scws_new’:
/root/scws-1.2.2/phpext/php_scws.c:278: warning: passing argument 4 of ‘add_property_resource_ex’ makes pointer from integer without a cast
/usr/local/php/include/php/Zend/zend_API.h:453: note: expected ‘struct zend_resource *’ but argument is of type ‘int’
/root/scws-1.2.2/phpext/php_scws.c: In function ‘zif_scws_close’:
/root/scws-1.2.2/phpext/php_scws.c:288: 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/scws-1.2.2/phpext/php_scws.c:288: error: too many arguments to function ‘zend_hash_find’
/root/scws-1.2.2/phpext/php_scws.c:288: warning: comparison between pointer and integer
/root/scws-1.2.2/phpext/php_scws.c:298: error: expected expression before ‘struct’
/root/scws-1.2.2/phpext/php_scws.c:300: warning: passing argument 1 of ‘zend_list_delete’ makes pointer from integer without a cast
/usr/local/php/include/php/Zend/zend_list.h:59: note: expected ‘struct zend_resource *’ but argument is of type ‘int’
/root/scws-1.2.2/phpext/php_scws.c: In function ‘zif_scws_set_charset’:
/root/scws-1.2.2/phpext/php_scws.c:313: 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/scws-1.2.2/phpext/php_scws.c:313: error: too many arguments to function ‘zend_hash_find’
/root/scws-1.2.2/phpext/php_scws.c:313: warning: comparison between pointer and integer
/root/scws-1.2.2/phpext/php_scws.c:325: error: expected expression before ‘struct’
/root/scws-1.2.2/phpext/php_scws.c: In function ‘zif_scws_add_dict’:
/root/scws-1.2.2/phpext/php_scws.c:345: 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/scws-1.2.2/phpext/php_scws.c:345: error: too many arguments to function ‘zend_hash_find’
/root/scws-1.2.2/phpext/php_scws.c:345: warning: comparison between pointer and integer
/root/scws-1.2.2/phpext/php_scws.c:357: error: expected expression before ‘struct’
/root/scws-1.2.2/phpext/php_scws.c: In function ‘zif_scws_set_dict’:
/root/scws-1.2.2/phpext/php_scws.c:396: 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/scws-1.2.2/phpext/php_scws.c:396: error: too many arguments to function ‘zend_hash_find’
/root/scws-1.2.2/phpext/php_scws.c:396: warning: comparison between pointer and integer
/root/scws-1.2.2/phpext/php_scws.c:408: error: expected expression before ‘struct’
/root/scws-1.2.2/phpext/php_scws.c: In function ‘zif_scws_set_rule’:
/root/scws-1.2.2/phpext/php_scws.c:446: 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/scws-1.2.2/phpext/php_scws.c:446: error: too many arguments to function ‘zend_hash_find’
/root/scws-1.2.2/phpext/php_scws.c:446: warning: comparison between pointer and integer
/root/scws-1.2.2/phpext/php_scws.c:458: error: expected expression before ‘struct’
/root/scws-1.2.2/phpext/php_scws.c: In function ‘zif_scws_set_ignore’:
/root/scws-1.2.2/phpext/php_scws.c:495: 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/scws-1.2.2/phpext/php_scws.c:495: error: too many arguments to function ‘zend_hash_find’
/root/scws-1.2.2/phpext/php_scws.c:495: warning: comparison between pointer and integer
/root/scws-1.2.2/phpext/php_scws.c:507: error: expected expression before ‘struct’
/root/scws-1.2.2/phpext/php_scws.c: In function ‘zif_scws_set_multi’:
/root/scws-1.2.2/phpext/php_scws.c:522: 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/scws-1.2.2/phpext/php_scws.c:522: error: too many arguments to function ‘zend_hash_find’
/root/scws-1.2.2/phpext/php_scws.c:522: warning: comparison between pointer and integer
/root/scws-1.2.2/phpext/php_scws.c:534: error: expected expression before ‘struct’
/root/scws-1.2.2/phpext/php_scws.c: In function ‘zif_scws_set_duality’:
/root/scws-1.2.2/phpext/php_scws.c:552: 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/scws-1.2.2/phpext/php_scws.c:552: error: too many arguments to function ‘zend_hash_find’
/root/scws-1.2.2/phpext/php_scws.c:552: warning: comparison between pointer and integer
/root/scws-1.2.2/phpext/php_scws.c:564: error: expected expression before ‘struct’
/root/scws-1.2.2/phpext/php_scws.c: In function ‘zif_scws_send_text’:
/root/scws-1.2.2/phpext/php_scws.c:579: 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/scws-1.2.2/phpext/php_scws.c:579: error: too many arguments to function ‘zend_hash_find’
/root/scws-1.2.2/phpext/php_scws.c:579: warning: comparison between pointer and integer
/root/scws-1.2.2/phpext/php_scws.c:591: error: expected expression before ‘struct’
/root/scws-1.2.2/phpext/php_scws.c:593: 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/scws-1.2.2/phpext/php_scws.c:593: 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/scws-1.2.2/phpext/php_scws.c:593: 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/scws-1.2.2/phpext/php_scws.c: In function ‘zif_scws_get_result’:
/root/scws-1.2.2/phpext/php_scws.c:615: 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/scws-1.2.2/phpext/php_scws.c:615: error: too many arguments to function ‘zend_hash_find’
/root/scws-1.2.2/phpext/php_scws.c:615: warning: comparison between pointer and integer
/root/scws-1.2.2/phpext/php_scws.c:625: error: expected expression before ‘struct’
/root/scws-1.2.2/phpext/php_scws.c:635:68: error: macro "add_assoc_stringl" passed 5 arguments, but takes just 4
/root/scws-1.2.2/phpext/php_scws.c:635: error: ‘add_assoc_stringl’ undeclared (first use in this function)
/root/scws-1.2.2/phpext/php_scws.c:639:78: error: macro "add_assoc_stringl" passed 5 arguments, but takes just 4
/root/scws-1.2.2/phpext/php_scws.c: In function ‘zif_scws_get_tops’:
/root/scws-1.2.2/phpext/php_scws.c:661: 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/scws-1.2.2/phpext/php_scws.c:661: error: too many arguments to function ‘zend_hash_find’
/root/scws-1.2.2/phpext/php_scws.c:661: warning: comparison between pointer and integer
/root/scws-1.2.2/phpext/php_scws.c:673: error: expected expression before ‘struct’
/root/scws-1.2.2/phpext/php_scws.c:684:45: error: macro "add_assoc_string" passed 4 arguments, but takes just 3
/root/scws-1.2.2/phpext/php_scws.c:684: error: ‘add_assoc_string’ undeclared (first use in this function)
/root/scws-1.2.2/phpext/php_scws.c:687:78: error: macro "add_assoc_stringl" passed 5 arguments, but takes just 4
/root/scws-1.2.2/phpext/php_scws.c:687: error: ‘add_assoc_stringl’ undeclared (first use in this function)
/root/scws-1.2.2/phpext/php_scws.c: In function ‘zif_scws_has_word’:
/root/scws-1.2.2/phpext/php_scws.c:706: 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/scws-1.2.2/phpext/php_scws.c:706: error: too many arguments to function ‘zend_hash_find’
/root/scws-1.2.2/phpext/php_scws.c:706: warning: comparison between pointer and integer
/root/scws-1.2.2/phpext/php_scws.c:718: error: expected expression before ‘struct’
/root/scws-1.2.2/phpext/php_scws.c: In function ‘zif_scws_get_words’:
/root/scws-1.2.2/phpext/php_scws.c:739: 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/scws-1.2.2/phpext/php_scws.c:739: error: too many arguments to function ‘zend_hash_find’
/root/scws-1.2.2/phpext/php_scws.c:739: warning: comparison between pointer and integer
/root/scws-1.2.2/phpext/php_scws.c:751: error: expected expression before ‘struct’
/root/scws-1.2.2/phpext/php_scws.c:759:45: error: macro "add_assoc_string" passed 4 arguments, but takes just 3
/root/scws-1.2.2/phpext/php_scws.c:759: error: ‘add_assoc_string’ undeclared (first use in this function)
/root/scws-1.2.2/phpext/php_scws.c:762:78: error: macro "add_assoc_stringl" passed 5 arguments, but takes just 4
/root/scws-1.2.2/phpext/php_scws.c:762: error: ‘add_assoc_stringl’ undeclared (first use in this function)
/root/scws-1.2.2/phpext/php_scws.c:776:22: error: macro "RETURN_STRING" passed 2 arguments, but takes just 1
/root/scws-1.2.2/phpext/php_scws.c: In function ‘zif_scws_version’:
/root/scws-1.2.2/phpext/php_scws.c:776: error: ‘RETURN_STRING’ undeclared (first use in this function)
make: *** [php_scws.lo] Error 1
[root@localhost phpext]#
查找这个用户的全部帖子
引用并回复
2015年12月20日, 17:46 (这个帖子最后修改于: 2015年12月20日 17:46 by man7870709.)
RE: 中文分词失败,怎么办?
恐怕是对php7支持不好,你可以再用php5系列试试
查找这个用户的全部帖子
引用并回复
2016年02月29日, 19:10
RE: 中文分词失败,怎么办?
我已经成功在 php7上编译了.
查找这个用户的全部帖子
引用并回复
发表回复 


论坛跳转:


正在浏览该主题的用户: 1 个游客