0

Recently, I needed to add a sftp connection in one of my WordPress template, I found a tutorial which used ssh2 (http://php.net/manual/fr/function.ssh2-sftp.php) but the ssh2 library is not in wp-includes. I found a .tgz file (http://pecl.php.net/package/ssh2), extracted it but all I found was some config files and .phpt files. Is there a simply way to add a PHP library to my WordPress?

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
Ankomm
  • 553
  • 2
  • 7
  • 15
  • http://php.net/manual/en/ssh2.installation.php has installation instructions. – apokryfos Oct 26 '17 at 08:06
  • If you're using ubuntu you can also do `sudo apt-get install libssh2-1 php-ssh2 -y` – apokryfos Oct 26 '17 at 08:13
  • I'm on Windows 10, and I saw the installation doc but how can I do it for my local and distant WordPress ? – Ankomm Oct 26 '17 at 08:23
  • http://php.net/manual/en/install.windows.legacy.index.php#install.windows.legacy.building has instructions for windows. Is your distant wordpress also on windows? – apokryfos Oct 26 '17 at 08:24
  • I downloaded the .dll files for ssh2, copied/past them into my UwAmp PHP folder, added 'extensions=php_ssh2.dll' in my php.ini, restart UwAmp and ... 'extensions=php_ssh2.dll' in php.ini disapeard. I saw it was the ssh2 files for PHP 5.5, but I'm on 5.6 and I don't find the .dll ssh2 files for PHP 5.6 ... – Ankomm Oct 26 '17 at 12:31
  • Version 0.12 is supposed to work for php 5+ (that would include 5.6) if it doesn't then the only way is to compile from source (or find another package) – apokryfos Oct 26 '17 at 12:36
  • What do you mean by 'Compile from source' ? – Ankomm Oct 26 '17 at 14:07
  • http://php.net/manual/en/install.windows.legacy.index.php#install.windows.legacy.building has a link to "compile PHP from sources on windows, using Microsoft's tools" and it links to https://wiki.php.net/internals/windows/stepbystepbuild – apokryfos Oct 26 '17 at 14:10

0 Answers0