您的位置 首页 php

PHP安装ssh2扩展

安装

下载包

$ wget http://www.libssh2.org/download/libssh2-1.4.2.tar.gz$ wget http://pecl.php.net/get/ssh2-0.12.tgz

先安装 libssh2 再安装 SSH2

$ tar -zxvf libssh2-1.4.2.tar.gz$ cd libssh2-1.4.2$ ./configure --prefix=/usr/local/libssh2$ make && make install

编译安装ssh2

$ tar -zxvf ssh2-0.12.tgz$ cd ssh2-0.12$ /usr/local/zend/bin/phpize$ ./configure --prefix=/usr/local/ssh2 --with-ssh2=/usr/local/libssh2 --with-php-config=/usr/local/zend/bin/php-config$ make && make install

修改php.ini 加入

extension=ssh2.so

重启PHP

调试

用户名密码方式登录

$user="root";//远程用户名$pass="******";//远程密码$connection=ssh2_connect('10.10.10.10',22);ssh2_auth_password($connection,$user,$pass);

用sshkey方式登录

$connection=ssh2_connect('10.10.10.10',22);if(ssh2_auth_pubkey_file($connection, 'root', '/home/id_rsa.pub', '/home/id_rsa', 'secret')){    echo "Public Key Authentication Successful\n";} else {        die('Public Key Authentication Failed');}

执行命令获取返回值

$cmd="ps aux";//命令$ret=ssh2_exec($connection,$cmd);stream_set_blocking($ret, true);echo (stream_get_contents($ret));

更多的PHP相关知识,请访问PHP中文网!

以上就是PHP安装ssh2扩展的详细内容,更多请关注求知技术网其它相关文章!

文章来源:智云一二三科技

文章标题:PHP安装ssh2扩展

文章地址:https://www.zhihuclub.com/2848.shtml

关于作者: 智云科技

热门文章

评论已关闭

29条评论

  1. Truncated somatostatin receptor 5 may modulate therapy response to somatostatin analogues Observations in two patients with acromegaly and severe headache

  2. In our study, overexpression of ASS1 in different types of arginine auxotrophic cancer cells gave variable degrees of ADI resistance To this union Angi Jo was born on November 4, 1967

  3. Plusieurs recommandations de traitement se fondent sur des opinions ou des anecdotes plutГґt que sur des Г©tudes scientifiques approfondies

  4. Apoptosis is initiated in response to minute concentrations of oestradiol, which results in dramatic tumour regression in heterotransplanted athymic mice

  5. Menopause symptoms since the drug reduce the estrogen hormone levels in your body and that s why it s advisable to take this drug after your childbearing age

  6. i understand what ur trying to say spanky but docs dont know everything there is to know about ur body Dosage Form Powder

  7. Si Si Si Si Si Si Si Si Si Si Si Si Si Si Si Si Si Si Si Si Si Si Si Si Si Si Si Si Si Si Si Si Si Si No Si Si Si Si Si Si Si Si Si Si Si Si Si Si Si Si Si Si Si Si Si No Si Si Si Si Si Si Si Si Si Si Si Si Si Si Si Si Si Si Si Si Si Si Si Si Si Si Si com 20 E2 AD 90 20Viagra 20Sandia 20Y 20Limon 20 20Harga 20Viagra 20Di 20Apotik viagra sandia y limon It added The handful of men who admit they broke the law does not reflect the honesty, integrity and character of the thousands of men and women who have worked at SAC over the past 21 years

  8. Unfortunately, our work with uterine lavage was suspended indefinitely in 1991 because of the HIV AIDS crisis Thus, the mean receiving Lupron had levels of testosterone similar to a woman

  9. Images of staining were acquired with the same exposure times and camera settings when comparing the same brain area in the different genotypes

  10. In contrast, three of the four NRL PRL adenocarcinomas displayed relatively high levels of CD44 Figure 5d, an adhesion molecule associated with stem cells and metastasis 64, 65 Indeed, while mCherry tagged wt CRY2 was strongly nuclear, L348F CRY2 showed a reduced proportion of protein in the nucleus Figure 2B

  11. Currently, there are very few clinical trials performed to validate whether green tea possesses chemo preventive or curative activity in significantly reducing cancer development

  12. In other words, of all people who end up with spontaneous pneumo, the most common other thing about them is that they are MALE THIN

  13. Based on our results, women with a regular cycle maybe offered hCG induced natural or CC induced cycle in FET

  14. The pharmacokinetics of the vulnerable chemotherapy treatments and antioxidants, including strategies for managing these interactions, has been reviewed in greater detail and can be helpful

  15. Ace Your Saunders Comprehensive Review For The NCLEX PN Examination, 8 Ed All explained 1 due to refusal and 3 due to failure to continue taking the medication

  16. Batlle DC, Grupp M, Gaviria M, Kurtzmen NA Distal renal tubular acidosis with intact capacity to lower urinary pH

  17. Ingle reports grants from NCI and Eisenberg Foundation during the conduct of the study It is not habit forming

网站地图