安装带有自制软件和php 7.3的ssh2扩展

问题描述 投票:0回答:1

尝试使用pecl安装ssh2扩展时,我遇到以下错误:

17 warnings and 3 errors generated.
make: *** [ssh2_fopen_wrappers.lo] Error 1
ERROR: `make' failed

这就是我所做的:

brew install php
brew install libssh2
pecl install ssh2-1.1.2

安装了php 7.3.3,libssh2 1.8.0并且无法安装ssh2-1.1.2。 有没有人有问题的解决方案?谢谢!

相关链接: https://github.com/docker-library/php/issues/767 Install PECL SSH2 extension for PHP

homebrew pecl libssh2 php-7.3 ssh2
1个回答
0
投票

尝试安装libssh2-1-dev

brew install libssh2-1-dev

更新pecl

pecl channel-update pecl.php.net

然后安装ssh2-1.1.2

brew install ssh2-1.1.2

这就是它对我有用的方式


0
投票

你可以使用this answer about docker

brew install libssh2-1-dev

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

phpize && ./configure && make && make install


echo "extension=ssh2.so" > /usr/local/etc/php/conf.d/ext-ssh2.ini

rm -rf /tmp/ssh2

0
投票

我原来的答案:SSH2 for PHP7 MacOS?

我终于在MacOS Mohave上找到了解决方案。我有Homebrew安装的PHP 7.3:

brew install php
brew install libssh2

从最新来源安装ssh2 pecl扩展的开发版本:

cd ~/Downloads
git clone https://git.php.net/repository/pecl/networking/ssh2.git
cd ssh2
phpize
./configure
make
make install

php.ini中启用扩展。您可以使用TextEdit:

open -e /usr/local/etc/php/7.3/php.ini

extension="ssh2.so"添加到文件的开头并保存。

测试结果:

php -i | grep libssh2

你应该看到

libssh2 version => 1.9.0
© www.soinside.com 2019 - 2024. All rights reserved.