title: phpseclib giving no compatible server or client encryption algorithms found in
body: <p>Hi All I appreciate that this question has been asked <a href="https://stackoverflow.com/questions/23641948/notice-no-compatible-server-to-client-encryption-algorithms-found-in">Notice: No compatible server to client encryption algorithms found in</a> but the suggestions and answers provided have not solved my scenario and did not in any way go into depth about this issue and explain how the 'stream_resolve_include_path()' works, restarting apache did not fix my issue nor did any include path instructions i tried.</p>
  
  <p>I do believe my issue is path related (maybe include path or maybe due to my directory structure but I'm unsure on how to fix.</p>
  
  <p>I'm trying to connect to a remote server via phpseclib and when i include the files in a subdirectory to the document root it works but my script running in the root throws the error in my question.</p>
  
  <p>phpseclib is running from the root and thus i have a directory structure as follows:</p>
  
  <p>docroot (where the file calling the script fails)</p>
  
  <ul>
  <li>classes (this is the folder where my call is completed successfully)</li>
  <li>Crypt (the folder phpseclib has its encrytion algorithms in)</li>
  <li>File (phpseclib folder)</li>
  <li>Math (phpseclib folder)</li>
  <li>Net  (where the ssh2 file for phpseclib is located)</li>
  <li>Service (phpseclib folder)</li>
  </ul>
  
  <p>a simplified version of my working file in classes is as follows:</p>
  
  <pre><code>&lt;?php
  set_include_path( '..' . DIRECTORY_SEPARATOR);
  
  include_once ('Net/SSH2.php');
  public function updatessh($sshId, $sshAddress, $sshUserName, $sshPassword, $port = 22) {
      $ssh = new Net_SSH2($sshAddress, $port);
      if (!ssh-&gt;login($sshUserName, $sshPassword)) {
          // Login failed
          ... code for failure
      } else {
          // Login success
          ... code for success
      }
  </code></pre>
  
  <p>this works fine, i login via ssh and can deal with the request.</p>
  
  <p>My non working code snippet in the docroot is almost identical as follows:</p>
  
  <pre><code>&lt;?php
  set_include_path(DIRECTORY_SEPARATOR);
  
  include_once ('Net/SSH2.php');
  public function updatessh($sshId, $sshAddress, $sshUserName, $sshPassword, $port = 22) {
      $ssh = new Net_SSH2($sshAddress, $port);
      if (!ssh-&gt;login($sshUserName, $sshPassword)) {
          // Login failed
          ... code for failure
      } else {
          // Login success
          ... code for success
      }
  </code></pre>
  
  <p>All parameters being passed into these functions are correct and verified numerous times trying to resolve this.</p>
  
  <p>I have tried the same include path as the working example, appending $_SERVER['DOCUMENT_ROOt'] doesn't work and not having the include fails too.</p>
  
  <p>I'm at a loss, must be missing something here, the file after it is included then calls its own includes to get the Crypt folder right, surely that would be the same no?</p>
  
  <p>the version of phpseclib is 0.3.something, I tried also with version 1 (which uses namespaces but had no success at all with that and as this was kind of working reverted to a non namespace version for this project.</p>
  
  <p>Any pointers would be appreciated. </p>