ich bin schon eine zeit lang im Web unterwegs und habe für mein Problem noch keine Lösung gefunden, deshalb ist meine ganze Hofdung auf dieses Forum gerichtet.
Ich habe SSH2 nach folgenden Angaben installiert.
- Ich habe mir das pecl "php_ssh2-0.12-5.4-ts-vc9-x86.zip" von
http://windows.php.net/downloads/pecl/releases/ssh2/0.12/
herunter geladen
- danach habe ich die beiden Dateien php_ssh2.dll and php_ssh2.pdb in den Ordner "ext" kopiert
- dann die Datei libssh2.dll ins Verzeichnis c:\windows\system32 kopiert und mit regsvr32 libssh2.dll registriert.
in der PHP.ini um den Eintrag
extension=php_ssh2.dll
erweitert
das ganze dann restartet.
Folgende infos
XAMPP 1.8.1
.. und aus der phpinfo() habe ich nun:
PHP Version 5.4.7
System Windows NT U226112 5.1 build 2600 (Windows XP Professional Service Pack 3) i586
Build Date Sep 12 2012 23:44:56
Compiler MSVC9 (Visual C++ 2008)
Architecture x86
PHP Extension 20100525
Zend Extension 220100525
Zend Extension Build API220100525,TS,VC9
PHP Extension Build API20100525,TS,VC9
Thread Safety enabled
durch diese Angaben nehme ich an das die Datei "php_ssh2-0.12-5.4-ts-vc9-x86.zip" die richtige ist.
Desweiteren sehe ich noch folgende infos.
Registered PHP Streams php, file, glob, data, http, ftp, zip, compress.zlib, compress.bzip2, phar, ssh2.shell, ssh2.exec, ssh2.tunnel, ssh2.scp, ssh2.sftp
Durch diese Infos nehme ich an das SSH2 korrekt installiert ist und am laufen.
Ich habe mir nun eine kleine Klasse geschrieben. wenn ich diese Aufrufe reagiert die Webseite nicht mehr und ich erhalte "Diese Webseite ist nicht mehr verfügbar"
Hier mal die Klasse:
- Code: Select all
<?php
error_reporting(E_ALL);
class ssh2
{
function __construct($ssh_host, $ssh_port, $ssh_user, $ssh_password)
{
$this->ssh_host = $ssh_host;
$this->ssh_port = $ssh_port;
$this->ssh_user = $ssh_user;
$this->ssh_password = $ssh_password;
if ($this->connect())
$this->ssh2auth();
}
function connect()
{
$this->sshConnection = ssh2_connect($this->ssh_host, $this->ssh_port);
if (!$this->sshConnection)
die ('Cannot connect to server');
}
function ssh2auth()
{
if (ssh2_auth_password($this->sshConnection, $this->ssh_user, $this->ssh_password))
{
die('authetification failed');
return false;
}
else
return true;
}
}
?>
hier noch den Aufruf
- Code: Select all
$ssh2 = new ssh2('mein server',22,'username','password');
sobald ich folgenden Code auskommentiere
- Code: Select all
/*
if ($this->connect())
$this->ssh2auth();
*/
funktioniert die Webseite wieder. Andere Webseiten die auch unter der gleichen XAMPP laufen, funktionieren immer.
mit Putty auf den Server via SSH funktioniert auch.
Wo kann ich da noch ansetzen um das Problem einzukreisen?
Vielen Dank für hilfreiche Infos