0

I am using PHP , I want to connect to remote server in SFTP, but the website said: Fatal error: Call to undefined function ssh2_connect() in D:\xampp\htdocs\dive\database.php on line 9

Can you tell me in detail how to do this? I tired

<?php
$connection = ssh2_connect('ftp.server.com', 22); 
if (ssh2_auth_password($connection, 'username', 'password')) 
    echo "Authentication success";
else 
    echo "Authentication failure";
?>

But it doesn't work.

After I connect to the server, is there a difference if I want to insert some data to the table in it? Which function should I use?

Xinrui Ma
  • 2,065
  • 5
  • 30
  • 52

1 Answers1

0

Have you installed / verified via phpinfo() that ssh2 is installed? Quick Google search seems to indicate it is not by default PHP Install SSH2 on Windows machine

Community
  • 1
  • 1
cs45977
  • 400
  • 3
  • 11