我想做一个SSH使用 php 连接到远程服务器。
我在 Linux/CEntOS 上使用 php 5.3。
到目前为止我所做的:
$connection = ssh2_connect('192.168.1.22', 22);
ssh2_auth_password($connection, '_username', '_password');
$stream = ssh2_exec($connection, 'ls -l');
但我收到此错误:
致命错误:调用未定义的函数 ssh2_connect()
所以,我的问题是:
Are ssh2_*
php 中没有默认安装的功能?
我需要扩展或库才能使用这些功能吗?
我怎么解决这个问题 ?
您可以配置您的服务器(Ubuntu):
sudo apt-get install libssh2-php
sudo service apache2 restart
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)