How to install PHPSECLIB on a WAMP environment with PEAR setup?

PEAR should be already installed in the system before configuring the phpseclib channel.

PHPSecLib installation is very simple.

PHPSecLib is a library of optional PHP extensions which comes in handy if the application were to be packaged as a solution for deployment to the end user.

Step 1: Register the channel

c:\> pear channel-discover

Step 2: List the packages available

c:\> pear remote-list -c phpseclib

Crypt_AES 0.3.1
Crypt_DES 0.3.1
Crypt_Hash 0.3.1
Crypt_RC4 0.3.1
Crypt_RSA 0.3.1
Crypt_Random 0.3.1
Crypt_Rijndael 0.3.1
Crypt_TripleDES 0.3.1
File_ANSI 0.3.1
File_ASN1 0.3.1
File_X509 0.3.1
Math_BigInteger 0.3.1
Net_SFTP 0.3.1
Net_SSH1 0.3.1
Net_SSH2 0.3.1

Step 3: Install the needed packages. For e.g. if you want Net_SFTP package

c:\> pear install phpseclib/Net_SFTP

For further instructions and notes go to PHP Secure Communications Library PEAR channel

If you have Php version 5.2.11, you may encounter issues installing phpseclib on it. For an easy install try a different version of php when you experiment with phseclib.

Sample program to test the functionality


set_include_path(get_include_path() . PATH_SEPARATOR . ‘/phpseclib’);


echo get_include_path();

$sftp = new Net_SFTP(‘greenland:22’);
if (!$sftp->login(‘root’, ‘evylouss’)) {
exit(‘Login Failed’);


Share it onShare on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

Written by kurinchilamp

Website: http://

Leave a Reply

Your email address will not be published. Required fields are marked *

Read previous post:
How to remove ^M characters at the end of lines in Vi from files in Linux?

Files created in windows when moved to linux will have ^M character at the end of lines when you open...