bonjour voila qq temps que j'essaye d installer ce system qui permet de se connecter a ssh via php
donc j'ai chercher ... et j'ai trouvé ceci :
Download and install OpenSSL. If you install OpenSSL via your distribution's packaging system be sure to install the development libraries as well. This will typically be a package named openssl-dev, openssl_devel, or some variation thereof.
Download and install libssh2 (http://sourceforge.net/projects/libssh2/). Typically this means executing the following command from the libssh2 source tree. ./configure && make all install.
Run the pear installer for PECL/ssh2: pear install ssh2
Copy ssh2.so from the directory indicated by the build process to the location specified in your php.ini file under extension_dir.
Add extension=ssh2.so to your php.ini
Restart your webserver to reload your php.ini settings
mais voici mon probleme :
cd /home/jicao/libssh2-0.10/
je l'installa avec le : ./configure && make all install comme demandé
puis quand je tappe : pear install ssh2 (dans le meme dossier /home/jicao/libssh2-0.10/)
et il me repond :
# pear install ssh2
PHP Warning: Unknown(): Unable to load dynamic library './ssh2.so' - ./ssh2.so: cannot open shared object file: No such file or directory in Unknown on line 0
Warning: Illegal offset type in Common.php on line 91
....
....
....
Warning: Illegal offset type in Common.php on line 108
Fatal error: Cannot instantiate non-existent class: pear_frontend_cli in /usr/local/lib/php/PEAR/Command.php on line 144
#
donc deja ca va pas ensuite je trouve deja mal expliquer que faire avec le php.ini :
Copy ssh2.so from the directory indicated by the build process to the location specified in your php.ini file under extension_dir.
Add extension=ssh2.so to your php.ini
ca veut dire quoi ? je dois faire quoi ?
et ensuite pourrais je une fois ce truc installer faire un script php style :
<?php
$connection = ssh2_connect('mon_ip', port);
ssh2_auth_password($connection, 'user', 'pass');
$stream = ssh2_exec($connection, 'ma_commande');
echo "start";
echo $stream ;
echo "end";
?>
voila bien le bonsoir ou bonjour a tous
++ merci d'avance