News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

PHPMaster.com:
Using SSH and SFTP with PHP
January 10, 2013 @ 11:31:52

On PHPMaster.com today there's a quick tutorial showing you how to use SSH and SFTP from inside your PHP applications (requiring the ssh2 package).

In today's world with so many third-party integrations and content-sharing, it's important to understand and make use of protocols like SCP and SFTP. PHP's SSH2 extension, a wrapper for libssh2 which implements the SSH2 protocol, provides several functions you can use to securely transfer files.

Sample code is included showing how to make a SSH request to a remote server, define the key files to use and execute a remote command (like scp). They also mention the use of wrapper functions like mkdir that also work with SSH/SFTP connections. The post finishes up with an example class or two you can use to wrap your connection handling and make it a bit more OOP-friendly.

0 comments voice your opinion now!
ssh sftp extension pecl tutorial oop


blog comments powered by Disqus

Similar Posts

SitePoint PHP Blog: Phalcon 2.0 Alpha Landing

Nefarious Designs: Object-Oriented PHP Part 4: PHP5's Improved Features

Community News: Latest PECL Releases for 07.24.2007

Maarten Balliauw's Blog: Accessing ServiceConfiguration in FastCGI (PHP) web role

PHPMaster.com: Maintaining your Server with Command Line PHP


Community Events

Don't see your event here?
Let us know!


language security php7 interview extension laravel5 laravel voicesoftheelephpant api opinion library introduction podcast series community list version framework example release

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework