I need to code a PHP script to do SFTP which requires SSH2 support in PHP. I have libssh2-1 installed but when I try to use the ssh2_connect function I get an error message saying ‘undefined function ssh2_connect()’. There are various things I can find about a package called php-ssh2 but nothing seems to exist for openSUSE TW. Does anyone have any ideas as to how I get this working please? I need a fairly vanilla method as this will have to port to a PHP installation on Windows as well and needs to be fairly straight forward.
The issue with the CENTOS instructions is that they dont come up with a downloadable package. I guess I have to work it out myself for a PHP7.4 package.
If you have ssh access on your server, you can use PHPseclib to connect to sftp in PHP. PHPseclib is a PHP sftp library that can use to easily create sftp connection and upload and download files from ftp.