You might need to install php-pecl-ssh2.i386.

if you don't, it would show the following message

[kevin@kevin tmp]$ php a.php
PHP Fatal error: Call to undefined function ssh2_connect() in /tmp/a.php on line 7

Fatal error: Call to undefined function ssh2_connect() in /tmp/a.php on line 7

The following the sample code of php with ssh

$password = "t35t";
$source = "/tmp/a.txt";
$dest = "/tmp/a.txt";
$conn = ssh2_connect('192.168.0.113', 22);
ssh2_auth_password($conn, $user, $password);
ssh2_scp_send($conn, $source, $dest);

ssh2_exec($conn, 'exit')

?>


arrow
arrow
    全站熱搜
    創作者介紹
    創作者 coolkevin 的頭像
    coolkevin

    about my life

    coolkevin 發表在 痞客邦 留言(0) 人氣()