©
This document uses PHP Chinese website manual Release
安装此 PECL 扩展相关的信息可在手册中标题为 PECL 扩展的安装章节中找到。更多信息如新的发行版本、下载、源文件、 维护人员信息及变更日志等,都在此处: » http://pecl.php.net/package/ssh2.
PECL 扩展的 DLL 当前不可用。参见 在 Windows 上构建章节。
[#1] francewhoa+php dot net at ubertus dot ca [2015-11-21 23:47:19]
Steps to install "ssh2" on Debian Jessie 8
1. Using Terminal as Root. Run the following command to install the extension package.
apt-get install php5-ssh2
2. Restart Apache2 server
service apache2 restart
[#2] sadhooklay AT gmail.com [2015-10-27 23:04:25]
Installing on Ubuntu 14.0.4
sudo pecl channel-update pecl.php.net
sudo apt-get install libssh2-1-dev
sudo pecl install -a ssh2-0.12
echo 'extension=ssh2.so' | sudo tee /etc/php5/mods-available/ssh2.ini > /dev/null
sudo php5enmod ssh2
[#3] warpman at gmail dot com [2014-11-18 16:10:48]
Installing this module for use with CentOS 5.?? or 6.?
1. Install your favorite PHP RPM packages. Make sure that one of your favorite packages is pear, so pecl gets installed in-tow.
2. Find and install *RPMS* of libssh2 of a version >= 1.2, get both the base lib package (libssh2-1.2.*.rpm) and the devel package that includes headers (libssh2-devel-1.2.*.rpm) of the EXACT SAME VERSION. Finding these packages took a few minutes of googling, and I invite an editor that has a trusted source for these to attach URLs as appropriate. (Yes, the version below is ancient)
# rpm -ivh libssh2-1.2.6-1.el5.rf.x86_64.rpm libssh2-devel-1.2.6-1.el5.rf.x86_64.rpm
3. Install the PHP module via pecl
# pecl install ssh2-0.12
4. Make PHP see the newly-installed extension
# echo "extension=ssh2.so" > /etc/php.d/ssh2.ini
5. Restart apache
[#4] zizifu at gmail dot com [2012-08-28 07:58:16]
CentOS 6.2 64bit Installation Steps:
1. download the libssh2 package from http://libssh2.org, command as following:
tar vxzf libssh2-1.4.2.tar.gz
cd libssh2-1.4.2
./configure
make
make install
2. download the php-ssh2 package from http://pecl.php.net/package/ssh2:
tar vxzf ssh2-0.11.3
cd ssh2-0.11.3
phpize
./configure --with-ssh2
make
make install
and the ssh2.so file will copy into /usr/lib64/php/modules
check it.
3. modify the php.ini
vi /etc/php.ini
add the "extension=ssh2.so" to the extension part of php.ini
4. check the environment of php, use phpinfo();
5. enjoy
[#5] dreadwestern at gmail dot com [2012-07-26 14:47:10]
Steps for installing the extension package on Debian systems:
> sudo apt-get install libssh2-php
> sudo /etc/init.d/apache2 restart
[#6] imedina at grosshat dot com [2010-12-09 02:09:34]
Using PECL it must be specified the channel, since the beta version has to be choosen instead of stable one:
$ pecl install ssh2 channel://pecl.php.net/ssh2-version
[#7] chris at 3menandarecorder dot com [2008-09-11 12:28:01]
To help someone avoid the headaches I did for a week. SSH2 functions have problems with the ssh2-beta & libssh2-0.18 even after patching with said patches on the internet.
ssh_exec will work fine
ssh2_shell will not work
In order to use ssh2_shell I had to roll back to libssh2-0.14 in order to get ssh2_shell function to work properly
[#8] arie dot mail at gmail dot com [2008-09-10 11:56:29]
Just a little note: when compiling this package after modifying the ssh2.c, do not use pecl build as it will not create an ssh2.so file (although it says it succeeded), use:
phpize
./configure --with-ssh2
make
you then need to copy the ssh2.so file into your extension dir if it didn't do so already.