我正在运行 Ubuntu 14.04 并想使用以下命令为 php 7 安装 ssh2 模块:
pecl install -f https://pecl.php.net/get/ssh2-1.1.2.tgz
我得到了这个回报:
downloading ssh2-1.1.2.tgz ...
Starting to download ssh2-1.1.2.tgz (32,057 bytes)
.........done: 32,057 bytes
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
6 source files, building
running: phpize
Configuring for:
PHP Api Version: 20180731
Zend Module Api No: 20180731
Zend Extension Api No: 320180731
libssh2 prefix? [autodetect] :
building in /tmp/pear/temp/pear-build-root2GcW3z/ssh2-1.1.2
running: /tmp/pear/temp/ssh2/configure --with-php-config=/usr/bin/php-config --with-ssh2
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php/20180731 -I/usr/include/php/20180731/main -I/usr/include/php/20180731/TSRM -I/usr/include/php/20180731/Zend -I/usr/include/php/20180731/ext -I/usr/include/php/20180731/ext/date/lib
checking for PHP extension directory... /usr/lib/php/20180731
checking for PHP installed headers prefix... /usr/include/php/20180731
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... re2c
checking for re2c version... 0.13.5 (ok)
checking for gawk... gawk
checking for ssh2 support... yes, shared
checking for ssh2 files in default path... found in /usr
checking for libssh2_session_hostkey in -lssh2... yes
checking for libssh2_agent_init in -lssh2... yes
checking for libssh2_session_set_timeout in -lssh2... yes
checking how to print strings... printf
checking for a sed that does not truncate output... (cached) /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking for gawk... (cached) gawk
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC -DPIC
checking if cc PIC flag -fPIC -DPIC works... yes
checking if cc static flag -static works... yes
checking if cc supports -c -o file.o... yes
checking if cc supports -c -o file.o... (cached) yes
checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
configure: creating ./config.status
config.status: creating config.h
config.status: executing libtool commands
running: make
/bin/bash /tmp/pear/temp/pear-build-root2GcW3z/ssh2-1.1.2/libtool --mode=compile cc -I. -I/tmp/pear/temp/ssh2 -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-root2GcW3z/ssh2-1.1.2/include -I/tmp/pear/temp/pear-build-root2GcW3z/ssh2-1.1.2/main -I/tmp/pear/temp/ssh2 -I/usr/include/php/20180731 -I/usr/include/php/20180731/main -I/usr/include/php/20180731/TSRM -I/usr/include/php/20180731/Zend -I/usr/include/php/20180731/ext -I/usr/include/php/20180731/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/ssh2/ssh2.c -o ssh2.lo
libtool: compile: cc -I. -I/tmp/pear/temp/ssh2 -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-root2GcW3z/ssh2-1.1.2/include -I/tmp/pear/temp/pear-build-root2GcW3z/ssh2-1.1.2/main -I/tmp/pear/temp/ssh2 -I/usr/include/php/20180731 -I/usr/include/php/20180731/main -I/usr/include/php/20180731/TSRM -I/usr/include/php/20180731/Zend -I/usr/include/php/20180731/ext -I/usr/include/php/20180731/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/ssh2/ssh2.c -fPIC -DPIC -o .libs/ssh2.o
/bin/bash /tmp/pear/temp/pear-build-root2GcW3z/ssh2-1.1.2/libtool --mode=compile cc -I. -I/tmp/pear/temp/ssh2 -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-root2GcW3z/ssh2-1.1.2/include -I/tmp/pear/temp/pear-build-root2GcW3z/ssh2-1.1.2/main -I/tmp/pear/temp/ssh2 -I/usr/include/php/20180731 -I/usr/include/php/20180731/main -I/usr/include/php/20180731/TSRM -I/usr/include/php/20180731/Zend -I/usr/include/php/20180731/ext -I/usr/include/php/20180731/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c -o ssh2_fopen_wrappers.lo
libtool: compile: cc -I. -I/tmp/pear/temp/ssh2 -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-root2GcW3z/ssh2-1.1.2/include -I/tmp/pear/temp/pear-build-root2GcW3z/ssh2-1.1.2/main -I/tmp/pear/temp/ssh2 -I/usr/include/php/20180731 -I/usr/include/php/20180731/main -I/usr/include/php/20180731/TSRM -I/usr/include/php/20180731/Zend -I/usr/include/php/20180731/ext -I/usr/include/php/20180731/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c -fPIC -DPIC -o .libs/ssh2_fopen_wrappers.o
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c: In function 'php_ssh2_fopen_wraper_parse_path':
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:236:2: warning: passing argument 1 of 'strlen' from incompatible pointer type [enabled by default]
if (strncmp(resource->scheme, "ssh2.", sizeof("ssh2.") - 1)) {
^
In file included from /usr/include/php/20180731/main/php_config.h:2623:0,
from /usr/include/php/20180731/main/php.h:32,
from /tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:25:
/usr/include/string.h:399:15: note: expected 'const char *' but argument is of type 'struct zend_string *'
extern size_t strlen (const char *__s)
^
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:236:2: warning: passing argument 1 of '__builtin_strlen' from incompatible pointer type [enabled by default]
if (strncmp(resource->scheme, "ssh2.", sizeof("ssh2.") - 1)) {
^
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:236:2: note: expected 'const char *' but argument is of type 'struct zend_string *'
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:236:2: warning: passing argument 1 of '__builtin_strcmp' from incompatible pointer type [enabled by default]
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:236:2: note: expected 'const char *' but argument is of type 'struct zend_string *'
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:236:2: warning: passing argument 1 of '__builtin_strlen' from incompatible pointer type [enabled by default]
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:236:2: note: expected 'const char *' but argument is of type 'struct zend_string *'
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:236:2: warning: passing argument 1 of '__builtin_strcmp' from incompatible pointer type [enabled by default]
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:236:2: note: expected 'const char *' but argument is of type 'struct zend_string *'
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:236:2: warning: passing argument 1 of '__builtin_strcmp' from incompatible pointer type [enabled by default]
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:236:2: note: expected 'const char *' but argument is of type 'struct zend_string *'
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:236:2: warning: passing argument 1 of '__builtin_strcmp' from incompatible pointer type [enabled by default]
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:236:2: note: expected 'const char *' but argument is of type 'struct zend_string *'
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:236:2: warning: passing argument 1 of 'strncmp' from incompatible pointer type [enabled by default]
In file included from /usr/include/php/20180731/main/php_config.h:2623:0,
from /usr/include/php/20180731/main/php.h:32,
from /tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:25:
/usr/include/string.h:147:12: note: expected 'const char *' but argument is of type 'struct zend_string *'
extern int strncmp (const char *__s1, const char *__s2, size_t __n)
^
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:242:2: warning: passing argument 1 of '__builtin_strlen' from incompatible pointer type [enabled by default]
if (strcmp(resource->scheme + sizeof("ssh2.") - 1, type)) {
^
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:242:2: note: expected 'const char *' but argument is of type 'struct zend_string *'
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:242:2: warning: passing argument 1 of '__builtin_strcmp' from incompatible pointer type [enabled by default]
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:242:2: note: expected 'const char *' but argument is of type 'struct zend_string *'
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:242:2: warning: passing argument 1 of '__builtin_strlen' from incompatible pointer type [enabled by default]
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:242:2: note: expected 'const char *' but argument is of type 'struct zend_string *'
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:242:2: warning: passing argument 1 of '__builtin_strcmp' from incompatible pointer type [enabled by default]
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:242:2: note: expected 'const char *' but argument is of type 'struct zend_string *'
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:242:2: warning: passing argument 1 of '__builtin_strcmp' from incompatible pointer type [enabled by default]
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:242:2: note: expected 'const char *' but argument is of type 'struct zend_string *'
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:242:2: warning: passing argument 1 of '__builtin_strcmp' from incompatible pointer type [enabled by default]
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:242:2: note: expected 'const char *' but argument is of type 'struct zend_string *'
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:256:4: warning: assignment from incompatible pointer type [enabled by default]
s = resource->path;
^
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:257:2: warning: passing argument 2 of 'strstr' from incompatible pointer type [enabled by default]
resource->path = estrdup(strstr(path, resource->path));
^
In file included from /usr/include/php/20180731/main/php_config.h:2623:0,
from /usr/include/php/20180731/main/php.h:32,
from /tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:25:
/usr/include/string.h:342:14: note: expected 'const char *' but argument is of type 'struct zend_string *'
extern char *strstr (const char *__haystack, const char *__needle)
^
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:257:17: warning: assignment from incompatible pointer type [enabled by default]
resource->path = estrdup(strstr(path, resource->path));
^
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:261:4: warning: assignment from incompatible pointer type [enabled by default]
s = resource->host;
^
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:312:24: error: invalid operands to binary == (have 'zend_string' and 'int')
if (resource->host[0] == 0 && context && psftp &&
^
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:326:24: error: invalid operands to binary == (have 'zend_string' and 'int')
if (resource->host[0] == 0 && context &&
^
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:402:3: warning: passing argument 1 of 'strlen' from incompatible pointer type [enabled by default]
int len = strlen(resource->user);
^
In file included from /usr/include/php/20180731/main/php_config.h:2623:0,
from /usr/include/php/20180731/main/php.h:32,
from /tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:25:
/usr/include/string.h:399:15: note: expected 'const char *' but argument is of type 'struct zend_string *'
extern size_t strlen (const char *__s)
^
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:405:13: warning: assignment from incompatible pointer type [enabled by default]
username = resource->user;
^
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:411:3: warning: passing argument 1 of 'strlen' from incompatible pointer type [enabled by default]
int len = strlen(resource->pass);
^
In file included from /usr/include/php/20180731/main/php_config.h:2623:0,
from /usr/include/php/20180731/main/php.h:32,
from /tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:25:
/usr/include/string.h:399:15: note: expected 'const char *' but argument is of type 'struct zend_string *'
extern size_t strlen (const char *__s)
^
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:414:13: warning: assignment from incompatible pointer type [enabled by default]
password = resource->pass;
^
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:425:2: warning: passing argument 1 of 'php_ssh2_session_connect' from incompatible pointer type [enabled by default]
session = php_ssh2_session_connect(resource->host, resource->port, methods, callbacks);
^
In file included from /tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:26:0:
/tmp/pear/temp/ssh2/php_ssh2.h:151:18: note: expected 'char *' but argument is of type 'struct zend_string *'
LIBSSH2_SESSION *php_ssh2_session_connect(char *host, int port, zval *methods, zval *callbacks);
^
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c: In function 'php_ssh2_shell_open':
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:530:7: warning: format '%s' expects argument of type 'char *', but argument 4 has type 'struct zend_string *' [-Wformat=]
php_error_docref(NULL, E_WARNING, "Failed setting %s=%s on remote end", key, Z_STRVAL(copyval));
^
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c: In function 'php_ssh2_fopen_wrapper_shell':
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:634:4: warning: assignment from incompatible pointer type [enabled by default]
s = resource->path ? resource->path : NULL;
^
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c: In function 'php_ssh2_exec_command':
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:769:7: warning: format '%s' expects argument of type 'char *', but argument 4 has type 'struct zend_string *' [-Wformat=]
php_error_docref(NULL, E_WARNING, "Failed setting %s=%s on remote end", key, Z_STRVAL(copyval));
^
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c: In function 'php_ssh2_fopen_wrapper_exec':
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:881:2: warning: passing argument 3 of 'php_ssh2_exec_command' from incompatible pointer type [enabled by default]
stream = php_ssh2_exec_command(session, resource_id, resource->path + 1, terminal, terminal_len, environment, width, height, type);
^
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:737:20: note: expected 'char *' but argument is of type 'struct zend_string *'
static php_stream *php_ssh2_exec_command(LIBSSH2_SESSION *session, int resource_id, char *command, char *term, int term_len, zval *environment, long width, long height, long type)
^
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c: In function 'php_ssh2_fopen_wrapper_scp':
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:1024:2: warning: passing argument 3 of 'php_ssh2_scp_xfer' from incompatible pointer type [enabled by default]
stream = php_ssh2_scp_xfer(session, resource_id, resource->path);
^
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:970:20: note: expected 'char *' but argument is of type 'struct zend_string *'
static php_stream *php_ssh2_scp_xfer(LIBSSH2_SESSION *session, int resource_id, char *filename)
^
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c: In function 'php_ssh2_fopen_wrapper_tunnel':
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:1265:42: error: invalid operands to binary == (have 'zend_string' and 'int')
if (resource->path && resource->path[0] == '/') {
^
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:1268:8: warning: assignment from incompatible pointer type [enabled by default]
host = resource->path + 1;
^
make: *** [ssh2_fopen_wrappers.lo] Error 1
ERROR: `make' failed
有人知道如何解决这个问题吗?
谢谢,