php7 ssh2,PHP7.3.5安装ssh2扩展

’ but argument is of type ‘struct zend_string’

static php_stream php_ssh2_exec_command(LIBSSH2_SESSIONsession, int resource_id, char command, charterm, int term_len, zval environment, long width, long height, long type)

^

/ssh2-1.1.2/ssh2_fopen_wrappers.c: In function ‘php_ssh2_fopen_wrapper_scp’:

/ssh2-1.1.2/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);

^

/ssh2-1.1.2/ssh2_fopen_wrappers.c:970:20: note: expected ‘char’ but argument is of type ‘struct zend_string ’

static php_streamphp_ssh2_scp_xfer(LIBSSH2_SESSION session, int resource_id, charfilename)

^

/ssh2-1.1.2/ssh2_fopen_wrappers.c: In function ‘php_ssh2_fopen_wrapper_tunnel’:

/ssh2-1.1.2/ssh2_fopen_wrappers.c:1265:42: error: invalid operands to binary == (have ‘zend_string’ and ‘int’)

if (resource->path && resource->path[0] == ‘/‘) {

^

/ssh2-1.1.2/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

上面下载的是最新的ssh2-1.1.2版本,无奈只能使用最新的代码进行安装

yum -y install git libssh2-devel

git clone https://git.php.net/repository/pecl/networking/ssh2.git

cd ssh2

/usr/local/php7.3.5/bin/phpize

./configure --with-php-config=/usr/local/php7.3.5/bin/php-config

make

make install

echo "extension=ssh2.so">>/usr/local/php7.3.5/etc/php.ini

rm -rf ../ssh2

原文:https://blog.51cto.com/fengwan/2395669

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值