【发布时间】:2019-07-26 10:06:52
【问题描述】:
尝试通过 pecl 安装扩展 ssh2 时,我遇到以下错误消息。我使用的是基于 php:7.3.2-fpm
重现步骤:
- 安装 PHP 7.3.2
- 安装包
libssh2-1-dev和libssh2-1 - 尝试通过
pecl install ssh2-1.1.2安装ssh2扩展
那么如何才能成功安装ssh2 扩展呢?
...
/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 {aka struct _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 [-Wincompatible-pointer-types]
host = resource->path + 1;
^
Makefile:196: recipe for target 'ssh2_fopen_wrappers.lo' failed
make: *** [ssh2_fopen_wrappers.lo] Error 1
ERROR: `make' failed
我发现this question 未得到答复,并在我第一次搜索时暂停了超级用户。我觉得这里更适合。
【问题讨论】: