Bindings to the libssh2 library which provide access to resources (shell, remote exec, tunneling, file transfer) on a remote machine using a secure cryptographic transport.
Windows binaries may be found at http://snaps.php.net/. To install, download php_ssh2.dll to the folder specified by your php.ini file's extension_dir directive. Enable it by adding extension=php_ssh2.dll to your php.ini and restarting your webserver.
Linux, BSD, and other *nix variants can be compiled using the following steps:
Download and install OpenSSL. If you install OpenSSL via your distribution's packaging system be sure to install the development libraries as well. This will typically be a package named openssl-dev, openssl_devel, or some variation thereof.
Download and install libssh2. Typically this means executing the following command from the libssh2 source tree. ./configure && make all install.
Run the pear installer for PECL/ssh2: pear install ssh2
Copy ssh2.so from the directory indicated by the build process to the location specified in your php.ini file under extension_dir.
Add extension=ssh2.so to your php.ini
Restart your webserver to reload your php.ini settings.
Development Versions: There are currently no stable versions of PECL/ssh2, to force installation of the beta version of PECL/ssh2 execute: pear install ssh2-beta
Compiling PECL/ssh2 without using the PEAR command: Rather than using pear install ssh2 to automatically download and install PECL/ssh2, you may download the tarball from PECL. From the root of the unpacked tarball, run: phpize && ./configure --with-ssh2 && make to generate ssh2.so. Once built, continue the installation from step 4 above.
注: You will need version 0.4 or greater of the libssh2 library (possibly higher, see release notes).
以下常量由本扩展模块定义，因此只有在本扩展模块被编译到 PHP 中，或者在运行时被动态加载后才有效。
Flag to ssh2_fingerprint() requesting hostkey fingerprint as an MD5 hash.
Flag to ssh2_fingerprint() requesting hostkey fingerprint as an SHA1 hash.
Flag to ssh2_fingerprint() requesting hostkey fingerprint as a string of hexits.
Flag to ssh2_fingerprint() requesting hostkey fingerprint as a raw string of 8-bit characters.
Flag to ssh2_shell() specifying that width and height are provided as character sizes.
Flag to ssh2_shell() specifying that width and height are provided in pixel units.
Default terminal width requested by ssh2_shell().
Default terminal height requested by ssh2_shell().
Default terminal units requested by ssh2_shell().
Flag to ssh2_fetch_stream() requesting STDIO subchannel.
Flag to ssh2_fetch_stream() requesting STDERR subchannel.
Default terminal type (e.g. vt102, ansi, xterm, vanilla) requested by ssh2_shell().