title: How to use PHP's set_include_path and multi directory library
body: <p>So I am using <a href="https://github.com/phpseclib/phpseclib/tree/2.0/phpseclib" rel="nofollow">PHP Secure Communications Library 2.0</a> in a project and it is being used in a number of places (different files in different subdirectories)</p>
  
  <p>Currently, to make it work I copy the 5 directories and 1 file into each sub-directory then include using <code>include('Net/SSH2.php');</code>  I'm sure this is incorrect.  </p>
  
  <p>The documentation says to use the following:</p>
  
  <pre><code>set_include_path(get_include_path() . PATH_SEPARATOR . 'phpseclib');
  include('Net/SSH2.php');
  </code></pre>
  
  <p>but I cannot get that to work.</p>
  
  <p>I have a file <code>/var/www/test.php</code> and I have <code>/var/www/phpseclib</code></p>
  
  <p>What I've done so far.</p>
  
  <pre><code>ini_set('display_errors', 1);
  echo get_include_path();  //Gets me .:
  set_include_path(get_include_path() . PATH_SEPARATOR . 'phpseclib');
  include('Net/SSH2.php');
  
  $sftp = new Net_SFTP('10.0.0.15');  //A valid IP for an SFTP host on the network
  </code></pre>
  
  <p>That results in <strong>Fatal error: Class 'Net_SFTP' not found in /var/www/test.php...</strong></p>
  
  <p>So then I moved the phpseclib directory to <code>/tmp</code> and change to <code>set_include_path(get_include_path() . PATH_SEPARATOR . '/tmp/phpseclib');</code></p>
  
  <p><code>$sftp = new Net_SFTP('10.0.0.15');</code> Still results in <strong>Fatal error: Class 'Net_SFTP' not found in /var/www/test.php...</strong></p>
  
  <p>So my structure is:
  (Permissions on all of the files in /Users/jason/tmp are set appropriately.)</p>
  
  <pre><code>/Users/jason/tmp/phpseclib
  /Users/jason/tmp/phpseclib/Crypt
  /Users/jason/tmp/phpseclib/File
  /Users/jason/tmp/phpseclib/Math
  /Users/jason/tmp/phpseclib/Net
  /Users/jason/tmp/phpseclib/System
  /Users/jason/tmp/phpseclib/openssl.cnf
  
  /var/www/test.php
  /var/www/A/two.php
  </code></pre>
  
  <p>And I want to use phpseclib in both <code>test.php</code> AND <code>two.php</code> and I feel like all I should need to do is add...</p>
  
  <pre><code>set_include_path(get_include_path() . PATH_SEPARATOR . '/tmp/phpseclib');
  include('Net/SSH2.php');
  </code></pre>
  
  <p>...to the top of each and be good to go.  What am I doing wrong/missing?</p>