Kervala
10/11/2011, 19h16
Sur les distributions Debian ou Ubuntu récentes, il existe le package : libssh2-php
phpize && ./configure --with-ssh2 && make checking ... checking ... checking ... checking ... /home/libssh2/ssh2-0.11.0/ssh2_fopen_wrappers.c: In function 'php_ssh2_channel_stream_read': /home/libssh2/ssh2-0.11.0/ssh2_fopen_wrappers.c:49: error: 'LIBSSH2_ERROR_EAGAIN' undeclared (first use in this function) /home/libssh2/ssh2-0.11.0/ssh2_fopen_wrappers.c:49: error: (Each undeclared identifier is reported only once /home/libssh2/ssh2-0.11.0/ssh2_fopen_wrappers.c:49: error: for each function it appears in.) make: *** [ssh2_fopen_wrappers.lo] Erreur 1
phpize && ./configure --with-ssh2 && make
ksxxxxxx/:/home/libssh2/ssh2-0.11.0# phpize && ./configure --with-ssh2 && make -bash: phpize: command not found
debian: /home/libssh2/ssh2-0.10# phpize && ./configure --with-ssh2 && make
Configuring for:
PHP Api Version: 20041225
Zend Module Api No: 20060613
Zend Extension Api No: 220060519
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc and cc understand -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
checking for PHP extension directory... /usr/lib/php5/20060613+lfs
checking for PHP installed headers prefix... /usr/include/php5
checking for re2c... no
configure: WARNING: You will need re2c 0.12.0 or later if you want to regenerate PHP parsers.
checking for gawk... no
checking for nawk... nawk
checking if nawk is broken... no
checking for ssh2 support... yes, shared
checking for ssh2 files in default path... not found
configure: error: The required libssh2 library was not found. You can obtain that package from http://sourceforge.net/projects/libssh2/
debian:/home/libssh2/ssh2-0.10# cd ..
debian:/home/libssh2# cd cd libssh2
-bash: cd: cd: Aucun fichier ou répertoire de ce type
debian:/home/libssh2# cd libssh2
-bash: cd: libssh2: Aucun fichier ou répertoire de ce type
debian:/home/libssh2# cd libssh2-0.14
debian:/home/libssh2/libssh2-0.14# ./configure && make all install
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for socket in -lsocket... no
checking for ceil in -lm... yes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ANSI C... (cached) none needed
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking whether make sets $(MAKE)... no
checking for ranlib... ranlib
checking whether byte ordering is bigendian... no
checking for pkg-config... /usr/bin/pkg-config
checking for OpenSSL... Using paths from pkg-config
checking for libz... Found in /usr/include /usr/lib
checking how to run the C preprocessor... gcc -E
checking for egrep... grep -E
checking for ANSI C header files... no
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking stdio.h usability... yes
checking stdio.h presence... yes
checking for stdio.h... yes
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking sys/uio.h usability... yes
checking sys/uio.h presence... yes
checking for sys/uio.h... yes
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking for poll... no
checking for gettimeofday... no
checking for select... no
checking for an ANSI C-conforming const... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating include/libssh2_config.h
config.status: include/libssh2_config.h is unchanged
-bash: make: command not found
in signedness
gcc -o session.o session.c -c -g -O2 -I/usr/include -I/usr/include -Wall -I../include/ -fPIC
session.c: In function 'libssh2_banner_send':
session.c:167: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness
session.c:168: warning: pointer targets in assignment differ in signedness
session.c: In function 'libssh2_session_startup':
session.c:363: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness
session.c:363: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness
session.c:363: warning: pointer targets in passing argument 2 of '__builtin_strcmp' differ in signedness
session.c:363: warning: pointer targets in passing argument 2 of '__builtin_strcmp' differ in signedness
session.c:363: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness
session.c:363: warning: pointer targets in passing argument 2 of '__builtin_strcmp' differ in signedness
session.c:363: warning: pointer targets in passing argument 2 of '__builtin_strcmp' differ in signedness
session.c:363: warning: pointer targets in passing argument 2 of 'strncmp' differ in signedness
gcc -o sftp.o sftp.c -c -g -O2 -I/usr/include -I/usr/include -Wall -I../include/ -fPIC
sftp.c: In function 'libssh2_sftp_packet_read':
sftp.c:169: warning: pointer targets in passing argument 3 of 'libssh2_channel_read_ex' differ in signedness
sftp.c:175: warning: pointer targets in passing argument 3 of 'libssh2_channel_read_ex' differ in signedness
sftp.c:180: warning: pointer targets in passing argument 3 of 'libssh2_channel_read_ex' differ in signedness
sftp.c:202: warning: pointer targets in passing argument 3 of 'libssh2_channel_read_ex' differ in signedness
sftp.c: In function 'libssh2_sftp_packet_ask':
sftp.c:249: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness
sftp.c:249: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness
sftp.c:249: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness
sftp.c:249: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness
sftp.c:249: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness
sftp.c:249: warning: pointer targets in passing argument 2 of '__builtin_strcmp' differ in signedness
sftp.c:249: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness
sftp.c:249: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness
sftp.c:249: warning: pointer targets in passing argument 2 of '__builtin_strcmp' differ in signedness
sftp.c:249: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness
sftp.c:249: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness
sftp.c:249: warning: pointer targets in passing argument 2 of '__builtin_strcmp' differ in signedness
sftp.c:249: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness
sftp.c:249: warning: pointer targets in passing argument 2 of '__builtin_strcmp' differ in signedness
sftp.c:249: warning: pointer targets in passing argument 1 of 'strncmp' differ in signedness
sftp.c:249: warning: pointer targets in passing argument 2 of 'strncmp' differ in signedness
sftp.c: In function 'libssh2_sftp_init':
sftp.c:490: warning: pointer targets in passing argument 3 of 'libssh2_channel_write_ex' differ in signedness
sftp.c:526: warning: pointer targets in assignment differ in signedness
sftp.c:529: warning: pointer targets in assignment differ in signedness
sftp.c: In function 'libssh2_sftp_open_ex':
sftp.c:592: warning: pointer targets in passing argument 3 of 'libssh2_channel_write_ex' differ in signedness
sftp.c: In function 'libssh2_sftp_read':
sftp.c:683: warning: pointer targets in passing argument 3 of 'libssh2_channel_write_ex' differ in signedness
sftp.c: In function 'libssh2_sftp_readdir':
sftp.c:735: warning: pointer targets in initialization differ in signedness
sftp.c:752: warning: pointer targets in assignment differ in signedness
sftp.c:778: warning: pointer targets in passing argument 3 of 'libssh2_channel_write_ex' differ in signedness
sftp.c:833: warning: pointer targets in assignment differ in signedness
sftp.c: In function 'libssh2_sftp_write':
sftp.c:871: warning: pointer targets in passing argument 3 of 'libssh2_channel_write_ex' differ in signedness
sftp.c: In function 'libssh2_sftp_fstat_ex':
sftp.c:930: warning: pointer targets in passing argument 3 of 'libssh2_channel_write_ex' differ in signedness
sftp.c: In function 'libssh2_sftp_close_handle':
sftp.c:1010: warning: pointer targets in passing argument 3 of 'libssh2_channel_write_ex' differ in signedness
sftp.c: In function 'libssh2_sftp_unlink_ex':
sftp.c:1081: warning: pointer targets in passing argument 3 of 'libssh2_channel_write_ex' differ in signedness
sftp.c: In function 'libssh2_sftp_rename_ex':
sftp.c:1148: warning: pointer targets in passing argument 3 of 'libssh2_channel_write_ex' differ in signedness
sftp.c: In function 'libssh2_sftp_mkdir_ex':
sftp.c:1219: warning: pointer targets in passing argument 3 of 'libssh2_channel_write_ex' differ in signedness
sftp.c: In function 'libssh2_sftp_rmdir_ex':
sftp.c:1271: warning: pointer targets in passing argument 3 of 'libssh2_channel_write_ex' differ in signedness
sftp.c: In function 'libssh2_sftp_stat_ex':
sftp.c:1338: warning: pointer targets in passing argument 3 of 'libssh2_channel_write_ex' differ in signedness
sftp.c: In function 'libssh2_sftp_symlink_ex':
sftp.c:1422: warning: pointer targets in passing argument 3 of 'libssh2_channel_write_ex' differ in signedness
gcc -o userauth.o userauth.c -c -g -O2 -I/usr/include -I/usr/include -Wall -I../include/ -fPIC
userauth.c: In function 'libssh2_userauth_list':
userauth.c:102: warning: pointer targets in return differ in signedness
userauth.c: In function 'libssh2_file_read_publickey':
userauth.c:291: warning: pointer targets in assignment differ in signedness
userauth.c:306: warning: pointer targets in assignment differ in signedness
userauth.c: In function 'libssh2_file_read_privatekey':
userauth.c:340: warning: pointer targets in passing argument 2 of '(*hostkey_method)->initPEM' differ in signedness
userauth.c:340: warning: pointer targets in passing argument 3 of '(*hostkey_method)->initPEM' differ in signedness
userauth.c: In function 'libssh2_userauth_hostbased_fromfile_ex':
userauth.c:400: warning: pointer targets in passing argument 4 of 'libssh2_file_read_privatekey' differ in signedness
userauth.c: In function 'libssh2_userauth_publickey_fromfile_ex':
userauth.c:571: warning: pointer targets in passing argument 4 of 'libssh2_file_read_privatekey' differ in signedness
gcc -o libssh2.so -shared -lm channel.o comp.o crypt.o hostkey.o kex.o mac.o misc.o packet.o publickey.o scp.o session.o sftp.o userauth.o -L/usr/lib -lcrypto -L/usr/lib -lz
make[1]: quittant le répertoire « /root/source/libssh2-0.14/src »
./mkinstalldirs /usr/local/include
./mkinstalldirs /usr/local/lib
make[1]: entrant dans le répertoire « /root/source/libssh2-0.14/src »
/usr/bin/install -c libssh2.so /usr/local/lib
make[1]: quittant le répertoire « /root/source/libssh2-0.14/src »
/usr/bin/install -c -m 644 include/libssh2.h /usr/local/include/
/usr/bin/install -c -m 644 include/libssh2_sftp.h /usr/local/include/
/usr/bin/install -c -m 644 include/libssh2_publickey.h /usr/local/include/
echo "extension=ssh2.so" >> /usr/local/psa/admin/conf/php.ini
echo "extension=ssh2.so" >> /etc/php.ini
Fatal error: Call to undefined function: ssh2_connect()
aptitude install autoconf
aptitude install automake
aptitude install libtool
apt-get update apt-get upgrade
aptitude install apache2 php5 php5-dev openssl libssl-dev
aptitude g++-3.4 make
cd /home mkdir libssh2 cd libssh2
wget http://ovh.dl.sourceforge.net/sourceforge/libssh2/libssh2-0.14.tar.gz
tar -xzvf libssh2-0.14.tar.gz
cd libssh2-0.14
./configure && make all install
cd ..
wget http://pecl.php.net/get/ssh2-0.10.tgz
tar -xzvf ssh2-0.10.tgz
cd ssh2-0.10
phpize && ./configure --with-ssh2 && make
echo "extension=ssh2.so" >> /etc/php5/apache2/php.ini
/etc/init.d/apache2 restart
echo "" >> /var/www/phpinfo-test.php