Pecl 安装 ssh2,make 失败

Pecl 安装 ssh2,make 失败

我花了两个小时努力尝试用 pecl 安装 ssh2...但我得到的只是:

/bin/sh /root/ssh2-0.11.0/libtool --mode=compile cc  -I. -I/root/ssh2-0.11.0 -DPHP_ATOM_INC -I/root/ssh2-0.11.0/include -I/root/ssh2-0.11.0/main -I/root/ssh2-0.11.0 -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  -DHAVE_CONFIG_H  -g -O2   -c /root/ssh2-0.11.0/ssh2.c -o ssh2.lo 
mkdir .libs
 cc -I. -I/root/ssh2-0.11.0 -DPHP_ATOM_INC -I/root/ssh2-0.11.0/include -I/root/ssh2-0.11.0/main -I/root/ssh2-0.11.0 -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 -DHAVE_CONFIG_H -g -O2 -c /root/ssh2-0.11.0/ssh2.c  -fPIC -DPIC -o .libs/ssh2.o
/root/ssh2-0.11.0/ssh2.c:52: error: duplicate 'static'
/root/ssh2-0.11.0/ssh2.c: In function 'zif_ssh2_methods_negotiated':
/root/ssh2-0.11.0/ssh2.c:503: warning: passing argument 4 of 'add_assoc_string_ex' discards qualifiers from pointer target type
/usr/include/php/Zend/zend_API.h:360: note: expected 'char *' but argument is of type 'const char *'
/root/ssh2-0.11.0/ssh2.c:504: warning: passing argument 4 of 'add_assoc_string_ex' discards qualifiers from pointer target type
/usr/include/php/Zend/zend_API.h:360: note: expected 'char *' but argument is of type 'const char *'
/root/ssh2-0.11.0/ssh2.c:508: warning: passing argument 4 of 'add_assoc_string_ex' discards qualifiers from pointer target type
/usr/include/php/Zend/zend_API.h:360: note: expected 'char *' but argument is of type 'const char *'
/root/ssh2-0.11.0/ssh2.c:509: warning: passing argument 4 of 'add_assoc_string_ex' discards qualifiers from pointer target type
/usr/include/php/Zend/zend_API.h:360: note: expected 'char *' but argument is of type 'const char *'
/root/ssh2-0.11.0/ssh2.c:510: warning: passing argument 4 of 'add_assoc_string_ex' discards qualifiers from pointer target type
/usr/include/php/Zend/zend_API.h:360: note: expected 'char *' but argument is of type 'const char *'
/root/ssh2-0.11.0/ssh2.c:511: warning: passing argument 4 of 'add_assoc_string_ex' discards qualifiers from pointer target type
/usr/include/php/Zend/zend_API.h:360: note: expected 'char *' but argument is of type 'const char *'
/root/ssh2-0.11.0/ssh2.c:516: warning: passing argument 4 of 'add_assoc_string_ex' discards qualifiers from pointer target type
/usr/include/php/Zend/zend_API.h:360: note: expected 'char *' but argument is of type 'const char *'
/root/ssh2-0.11.0/ssh2.c:517: warning: passing argument 4 of 'add_assoc_string_ex' discards qualifiers from pointer target type
/usr/include/php/Zend/zend_API.h:360: note: expected 'char *' but argument is of type 'const char *'
/root/ssh2-0.11.0/ssh2.c:518: warning: passing argument 4 of 'add_assoc_string_ex' discards qualifiers from pointer target type
/usr/include/php/Zend/zend_API.h:360: note: expected 'char *' but argument is of type 'const char *'
/root/ssh2-0.11.0/ssh2.c:519: warning: passing argument 4 of 'add_assoc_string_ex' discards qualifiers from pointer target type
/usr/include/php/Zend/zend_API.h:360: note: expected 'char *' but argument is of type 'const char *'
/root/ssh2-0.11.0/ssh2.c: In function 'zif_ssh2_publickey_add':
/root/ssh2-0.11.0/ssh2.c:1045: warning: passing argument 1 of '_efree' discards qualifiers from pointer target type
/usr/include/php/Zend/zend_alloc.h:46: note: expected 'void *' but argument is of type 'const char *'
/root/ssh2-0.11.0/ssh2.c: In function 'zif_ssh2_publickey_list':
/root/ssh2-0.11.0/ssh2.c:1104: warning: passing argument 4 of 'add_assoc_stringl_ex' discards qualifiers from pointer target type
/usr/include/php/Zend/zend_API.h:361: note: expected 'char *' but argument is of type 'const unsigned char *'
/root/ssh2-0.11.0/ssh2.c:1105: warning: passing argument 4 of 'add_assoc_stringl_ex' discards qualifiers from pointer target type
/usr/include/php/Zend/zend_API.h:361: note: expected 'char *' but argument is of type 'const unsigned char *'
make: *** [ssh2.lo] Error 1

我在 Google 上搜索了很多次,发现有些补丁根本不起作用。所以如果你认为你可以帮助我,那就继续吧!

谢谢!

答案1

我知道这是一篇旧帖子,但我想我会回答它,因为我刚刚遇到了同样的错误,必须修复它。不确定你是否在旅行中找到了此补丁,但它对我有用。

下面的链接会引导你找到可以修复此构建错误的补丁

http://pecl.php.net/bugs/bug.php?id=16727&edit=1

相关内容