某模块需要用到php的ssh2扩展,而cpanel中默认没有安装该扩展,需要手动安装:
首先登入ssh:
yum install libssh2-devel pecl install ssh2
然后验证是否成功安装:
root@server [/]# php -m | grep ssh2 ssh2 root@server [/]# php -i | grep ssh2 Registered PHP Streams => https, ftps, compress.zlib, php, file, glob, data, http, ftp, phar, ssh2.shell, ssh2.exec, ssh2.tunnel, ssh2.scp, ssh2.sftp ssh2 libssh2 version => 1.4.2 banner => SSH-2.0-libssh2_1.4.2
如果提示
root@server [~]# pecl install ssh2 Failed to download pecl/ssh2 within preferred state “stable”, latest release is version 0.12, stability “beta”, use “channel://pecl.php.net/ssh2-0.12” to install install failed
请尝试手动下载(http://pecl.php.net/package/ssh2)并编译:
tar vxzf packagename cd ssh2* phpize ./configure –with-ssh2 make make install
也可以使用WHM后台在"主页 »软件 »模块安装程序"处进行图形化安装:
找到PHP Pecl,点击后面的Manage,搜索安装SSH2即可.
Comments NOTHING