CodeIgniter sFTP Library
A CodeIgniter sFTP Library - Allows communication to a sFTP server via the CodeIgniter framework.
Many thanks to;
- PHP 5+
- CodeIgniter for 2.x
- ssh2 extension for PHP (which in turn needs libssh2)
Have a look at
application/controllers/sftp_test.php for an example of how to connect
to a remote sFTP server, as well as a few demo commands you can run.
libssh2 & ssh2 installation on OSX 10.9
Here's an updated guide to installing this extension on OSX 10.9 (Mavericks).
I'm using the default OSX PHP install (5.4.24) that comes pre-installed. This guide also assumes you're using Homebrew as a package manager, and have wget installed.
This is very similar to the process on this gist.
1) Install libssh2;
brew install libssh2
2) Install ssh2;
tar -zxvf ssh2-0.11.3.tgz
3) Copy your newly compiled extension (ssh2.so) into your PHP extensions directory.
sudo cp modules/ssh2.so /usr/lib/php/extensions/no-debug-non-zts-20100525
4) Add the extension to the php.ini. Just add the following text to the php.ini file;
6) Restart apache and run php info to see if the extension has been loaded;
php -i | grep ssh2
You should be good to go from here!
The main thing is that libssh2, ssh2 and php are all the same architecture (32 or 64bit).