PHP 5.6を実行しているUbuntu 14.04にPHP SSH2拡張機能をインストールする方法は?

PHP 5.6を実行しているUbuntu 14.04にPHP SSH2拡張機能をインストールする方法は?

私が実行すると、sudo apt-get install libssh2-1-dev libssh2-php次のようになります。

Reading package lists... Done
Building dependency tree
Reading state information... Done
libssh2-php is already the newest version.
libssh2-1-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 71 not upgraded.

しかし、これはうまくいきません。実行時にインストールされたものは表示されません。php -m |grep ssh2 #you should see ssh2

次に、どのような措置を講じますか?注目すべき点は、実行時に接続されていることsudo apt-get updateを発見したことですhttp://archive.ubuntu.com trusty/multiverse。これが問題になる可能性がありますか?

ベストアンサー1

PHP5用のssh2拡張機能をインストールするには、次の手順を実行します。

sudo apt-get install gcc make autoconf libc-dev pkg-config php5-dev
sudo pecl install ssh2-0.13

または

sudo pecl install https://pecl.php.net/get/ssh2-0.13.tgz

php-fpmサービスを再起動し、次のことを確認します。

php -i | grep ssh2

ペック:ssh2

おすすめ記事