ssh2 problem installation (WinXp)

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
User avatar
spiker84
Forum Newbie
Posts: 8
Joined: Tue Jun 12, 2007 1:43 pm

ssh2 problem installation (WinXp)

Post by spiker84 »

hi, i'have a problem with installation of ssh2 extension: Apache_ssl 2.2.* , Php 5.2.3.3, Mysql5


initially i've downloaded php_ssh2.dll and i put it in php/ext --->>nothing

after i've use command pear:

pear install ssh2 -->> nothing

pear install ssh2-0.10 -->> nothing

pear install pecl.php.net/ssh2 -0.10 --->> nothig


the error is impossible found .dsp file -->> argggggggggg

and apache tell : "an exception occured : ssh2 not supported!!!! "
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Re: ssh2 problem installation (WinXp)

Post by timvw »

From what i remember:

- get the dll, put in your extension directory
- edit php.ini so that the extension is loaded
- restart apache (perhaps that reloading is enough)
User avatar
spiker84
Forum Newbie
Posts: 8
Joined: Tue Jun 12, 2007 1:43 pm

re

Post by spiker84 »

i've do it-....


i download php_ssh2.ddl , put it in php/ext (my extesion directory), and i've modified php.ini:


extension=php_ssh2.dll


apache not generate error on startup, the extesion is load but when i used a ssh2 php class apache tell:


an exception occurred: ssh2 not supported


i need apache ssl??????


thanks!!!!!!!
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Re: re

Post by timvw »

You can verify if the extension is loaded by seeing if it's in the list:

Code: Select all

<?php
print_r(get_loaded_extensions());
?>

Perhaps there is a different in the class you're using? Show us some code...
User avatar
spiker84
Forum Newbie
Posts: 8
Joined: Tue Jun 12, 2007 1:43 pm

argggg

Post by spiker84 »

i'callad this funciont and the array result :


rray ( [0] => bcmath [1] => calendar [2] => com_dotnet [3] => ctype [4] => session [5] => filter [6] => ftp [7] => hash [8] => iconv [9] => json [10] => odbc [11] => pcre [12] => Reflection [13] => date [14] => libxml [15] => standard [16] => tokenizer [17] => zlib [18] => SimpleXML [19] => dom [20] => SPL [21] => wddx [22] => xml [23] => xmlreader [24] => xmlwriter [25] => apache2handler [26] => gd [27] => mbstring [28] => mysql [29] => ssh2 [30] => zip )


there are extension loaded but when i used ssh , apche told the same errorr
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Re: ssh2 problem installation (WinXp)

Post by volka »

spiker84 wrote:and apache tell : "an exception occured : ssh2 not supported!!!! "
please post the code that caused that error message.
And what does

Code: Select all

print_r(get_extension_funcs('ssh2'));
print?
User avatar
spiker84
Forum Newbie
Posts: 8
Joined: Tue Jun 12, 2007 1:43 pm

thanks!!!!

Post by spiker84 »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


ok, thaks for help!!!!


the follow code:

Code: Select all

<?php
            print_r(get_loaded_extensions());
            echo "<br><br>";
	    print_r(get_extension_funcs('ssh2'));

?>
print:

Array ( [0] => bcmath [1] => calendar [2] => com_dotnet [3] => ctype [4] => session [5] => filter [6] => ftp [7] => hash [8] => iconv [9] => json [10] => odbc [11] => pcre [12] => Reflection [13] => date [14] => libxml [15] => standard [16] => tokenizer [17] => zlib [18] => SimpleXML [19] => dom [20] => SPL [21] => wddx [22] => xml [23] => xmlreader [24] => xmlwriter [25] => apache2handler [26] => mbstring [27] => mysql [28] => ssh2 )

Array ( [0] => ssh2_connect [1] => ssh2_methods_negotiated [2] => ssh2_fingerprint [3] => ssh2_auth_none [4] => ssh2_auth_password [5] => ssh2_auth_pubkey_file [6] => ssh2_auth_hostbased_file [7] => ssh2_forward_listen [8] => ssh2_forward_accept [9] => ssh2_shell [10] => ssh2_exec [11] => ssh2_tunnel [12] => ssh2_scp_recv [13] => ssh2_scp_send [14] => ssh2_fetch_stream [15] => ssh2_poll [16] => ssh2_sftp [17] => ssh2_sftp_rename [18] => ssh2_sftp_unlink [19] => ssh2_sftp_mkdir [20] => ssh2_sftp_rmdir [21] => ssh2_sftp_stat [22] => ssh2_sftp_lstat [23] => ssh2_sftp_symlink [24] => ssh2_sftp_readlink [25] => ssh2_sftp_realpath [26] => ssh2_publickey_init [27] => ssh2_publickey_add [28] => ssh2_publickey_remove [29] => ssh2_publickey_list )





And the code that generate exception is:

Code: Select all

<?php

require_once ('ssh_in_php.php');

$host = "127.0.0.1";
$port = 22;
$user = "axel";
$password = "axel";

try {
	$ssh = new SSH_in_PHP($host,$port);
	$ssh->connect($user,$password);

	$cycle = true;
	while ($cycle) {
		$data = $ssh->read();
		echo $data;
		if (ereg('\$',$data)) {
			$cycle = false;
		}
	}
	$ssh->write("uname -a\n");
	$cycle = true;
	while ($cycle) {
		$data = $ssh->read();
		echo $data;
		if (ereg('\$',$data)) {
			$cycle = false;
		}
	}

	$ssh->write("ls -al\n");
	$cycle = true;
	while ($cycle) {
		$data = $ssh->read();
		echo $data;
		if (ereg('\$',$data)) {
			$cycle = false;
		}
	}

	$ssh->disconnect();

} catch (SSHException $e) {
	echo "An Exception Occured: {$e->getMessage()} ({$e->getCode()})\n";
	echo "Trace: \n";
	echo print_r($e->getTrace());
	echo "\n";
}

?>

the class ssh_in_php is downloaded form http://www.phpclasses.org and differet people use there!!!!!!!

i don't understand were is the problem!!!!!



8) thanks


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

This class doesn't use the extension module php_ssh2.dll at all.
http://www.phpclasses.org/browse/file/10338.html wrote:Class: SSH in PHP
SSH client implementation in pure PHP
ssh_in_php.php wrote:* supports only SSHv1, but SSHv2 implementation will be done - at some day
Post Reply