yumでssh2をインストールした。


wordpressのupdate用にSSH2をyumでインストールしたメモ

まずはphp-pearをインストール

# yum install php-pear

次にlibssh2 libssh2-devel

# yum install libssh2 libssh2-devel

更にpecl installでssh2を入れる

# pecl install ssh2
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
pecl/ssh2 requires PHP (version >= 4.0.0, version <= 6.0.0), installed version is 7.2.5 No valid packages found install failed

怒られてしまったので言われるままにpecl channel-updateを実行

[root@higherhope html]# pecl channel-update pecl.php.net
Updating channel "pecl.php.net"
Update of Channel "pecl.php.net" succeeded

再度挑戦

# pecl install ssh2
pecl/ssh2 requires PHP (version >= 4.0.0, version <= 6.0.0), installed version is 7.2.5 No valid packages found install failed

peclではPHP 7.2.5に対応するssh2は無いらしいのでyumでリベンジ

# yum install php-pecl-ssh2
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: ftp.riken.jp
* epel: mirror.dmmlabs.jp
* extras: ftp.riken.jp
* remi-php72: mirrors.thzhost.com
* remi-safe: mirrors.thzhost.com
* updates: ftp.riken.jp
Resolving Dependencies
--> Running transaction check
---> Package php-pecl-ssh2.x86_64 0:1.1.2-1.el7.remi.7.2 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
php-pecl-ssh2 x86_64 1.1.2-1.el7.remi.7.2 remi-php72 44 k

Transaction Summary
================================================================================
Install 1 Package

Total download size: 44 k
Installed size: 171 k
Is this ok [y/d/N]: y
Downloading packages:
php-pecl-ssh2-1.1.2-1.el7.remi.7.2.x86_64.rpm | 44 kB 00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : php-pecl-ssh2-1.1.2-1.el7.remi.7.2.x86_64 1/1
Verifying : php-pecl-ssh2-1.1.2-1.el7.remi.7.2.x86_64 1/1

Installed:
php-pecl-ssh2.x86_64 0:1.1.2-1.el7.remi.7.2

インストール成功

念のためサービス再起動して終了

# systemctl restart nginx
# systemctl restart php-fpm

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です