title: I am creating PHP page in which i am downloading .CSV file from SFTP server
body: <p>I want to download file from SFTP so i created page which looks like it.</p>
  
  <pre><code> &lt;?php
       $username = "XYZ";
       $password = "ABC";
       $url ='FTP.abc.COM';
       // Make our connection
       $connection = ssh2_connect($url);
       // Authenticate
       if (!ssh2_auth_password($connection, $username, $password)) throw new Exception('Unable to connect.');
      // Create our SFTP resource
      if (!$sftp = ssh2_sftp($connection)) throw new Exception('Unable to create SFTP connection.');
  
     $localDir  = '/path/to/your/local/dir';
     $remoteDir = '/path/to/your/remote/dir';
  
     // download all the files
     $files    = scandir('ssh2.sftp://' . $sftp . $remoteDir);
     if (!empty($files))
      {
       foreach ($files as $file) {
          if ($file != '.' &amp;&amp; $file != '..')
          {
             ssh2_scp_recv($connection, "$remoteDir/$file", "$localDir/$file");
          }
      }
  }
  ?&gt;
  </code></pre>
  
  <p>When i will call this page from browser. It will show error look like it.</p>
  
  <pre><code>Fatal error: Call to undefined function ssh2_connect() in page.php on line 6
  </code></pre>
  
  <p>if this method is correct then what should i edit in this page?
  and if there is another method then suggest me that method. Thanks in advance.</p>