0

I want to connect to remote server and execute some commands. The server is running in Ubuntu and I am working on Windows. I am trying to implement ssh. But the connection is not working. Its my first time to work with ssh. I have searched a lot and after downloaded the required dll files from PECL and added to php/ext path. Also enabled the dll in php.ini file. But the code is not working. It throws an error like Fatal error: Uncaught Error: Call to undefined function ssh2_connect()

<?php 
  $connection = ssh2_connect('xxx.xxx.xxx.xx', 22);
 if (!$connection) die('Connection failed');
?>

enter image description here

enter image description here

I have already added the extension in php.ini, but when I try to print the phpinfo(), it shows nothing about ssh2 extension.

geeth
  • 704
  • 2
  • 14
  • 42
  • 4
    Possible duplicate of [PHP function ssh2\_connect is not working](https://stackoverflow.com/questions/14050231/php-function-ssh2-connect-is-not-working) – Jacob Aug 08 '18 at 10:24

1 Answers1

1

Moved libssh2.dll from xampp/php folder to system32 and its working now

geeth
  • 704
  • 2
  • 14
  • 42