function ssh2_connect doesnot exist
<p>I'm trying to set a ssh call to a button using PHP.</p>

<p>When I tried the ssh using <code>ssh2_connect()</code> function , the following <strong>error</strong> occurred in my browser :</p>

<blockquote>
  <p>function ssh2_connect does not exist</p>
</blockquote>

<p><strong>Packages installed :</strong></p>

<pre><code>automake make php-devel libtool openssl-devel gcc++ gcc

wget http://pecl.php.net/get/ssh2-0.12.tgz
</code></pre>

<p><strong>After installation</strong> <strong>I could not find the <code>ssh2.ini</code> file</strong>. I have only the <code>ssh2.so</code> file in my extensions directory. </p>

<p><strong>Request :</strong></p>

<p>Please help me resolve this problem, so that I can successfully <code>ssh</code> to my target server .</p>

<p><strong>My Code :</strong></p>

<ol>
<li><p><strong>example.php</strong> (setting a ssh action to a button , this redirects to index.php )</p>

<pre><code>&lt;form action="index.php"method="get"&gt;
    &lt;input type="hidden" name="act" value="run"&gt;
    &lt;input type="submit" value="run"&gt;
&lt;/form&gt;
</code></pre></li>
<li><p><strong>index.php</strong></p>

<pre><code>&lt;?php

    if (!function_exists("ssh2_connect")) die("function ssh2_connect doesnot exist");

     if (!($con = ssh2_connect("My server IP", 22))){
          echo "fail:unable to establish connection";
     }else{
          echo "we are logged in ";
     if (!($stream = ssh2_exec($con, "ls -al"))) {
          echo "fail:unable to exec command";
     }else{
          stream_set_blocking($stream,true);
          $data = "";
          while ($buf = fread($stream,4096)){
          $data .= $buf;
     }
     fclose($stream);
    }
}
?&gt;
</code></pre></li>
</ol>