Автор Тема: Установка ssh2 расширения для PHP [решено]  (Прочитано 4429 раз)

Оффлайн kon-dv

  • Участник
  • *
  • Сообщений: 724
    • Заметки учителя
Всем доброго времени суток. Возникла проблема в установке установка ssh2 расширения для PHP. ALT Linux 6.0. Пробовал так:
#apt-get install php-devel libssh2-devel php-pear
# pecl install -f ssh2
WARNING: failed to download pecl.php.net/ssh2 within preferred state "stable", w
ill instead download version 0.11.3, stability "beta"
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-upd
ate pecl.php.net" to update
downloading ssh2-0.11.3.tgz ...
Starting to download ssh2-0.11.3.tgz (23,062 bytes)
........done: 23,062 bytes
5 source files, building
running: phpize
Configuring for:
PHP Api Version:         20090626
Zend Module Api No:      20090626
Zend Extension Api No:   220090626
configure.in:3: warning: prefer named diversions
configure.in:3: warning: prefer named diversions
libssh2 prefix? [autodetect] :
building in /var/tmp/pear-build-root/ssh2-0.11.3
running: /tmp/.private/root/pear/temp/ssh2/configure --with-ssh2
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 cc... cc
checking whether the C compiler works... no
configure: error: in `/var/tmp/pear-build-root/ssh2-0.11.3':
configure: error: C compiler cannot create executables
See `config.log' for more details.
ERROR: `/tmp/.private/root/pear/temp/ssh2/configure --with-ssh2' failed
[root@server php.d]#
Help....
« Последнее редактирование: 30.04.2012 18:48:54 от Skull »
Морфиус на меня обиделся...

Оффлайн Skull

  • Глобальный модератор
  • *****
  • Сообщений: 20 166
    • Домашняя страница
Re: Установка ssh2 расширения для PHP
« Ответ #1 : 30.04.2012 08:05:47 »
checking whether the C compiler works... no
Нет компилятора. Установите минимальный комплект для сборки:
apt-get install rpm-build
Андрей Черепанов (cas@)

Оффлайн kon-dv

  • Участник
  • *
  • Сообщений: 724
    • Заметки учителя
Re: Установка ssh2 расширения для PHP
« Ответ #2 : 30.04.2012 09:07:29 »
Спасибо. установка вроде прошла:

[root@server ~]# pecl install -f ssh2
WARNING: failed to download pecl.php.net/ssh2 within preferred state "stable", w
ill instead download version 0.11.3, stability "beta"
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-upd
ate pecl.php.net" to update
downloading ssh2-0.11.3.tgz ...
Starting to download ssh2-0.11.3.tgz (23,062 bytes)
........done: 23,062 bytes
5 source files, building
running: phpize
Configuring for:
PHP Api Version:         20090626
Zend Module Api No:      20090626
Zend Extension Api No:   220090626
configure.in:3: warning: prefer named diversions
configure.in:3: warning: prefer named diversions
libssh2 prefix? [autodetect] :
building in /var/tmp/pear-build-root/ssh2-0.11.3
running: /tmp/.private/root/pear/temp/ssh2/configure --with-ssh2
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 cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -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/php/5.3.10 -I/usr/include/php/5.3.10
/main -I/usr/include/php/5.3.10/TSRM -I/usr/include/php/5.3.10/Zend -I/usr/inclu
de/php/5.3.10/ext -I/usr/include/php/5.3.10/ext/date/lib
checking for PHP extension directory... /usr/lib/php/5.3.10/extensions
checking for PHP installed headers prefix... /usr/include/php/5.3.10
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate
 PHP parsers.
checking for gawk... gawk
checking for ssh2 support... yes, shared
checking for ssh2 files in default path... found in /usr
checking for libssh2_banner_set in -lssh2... yes
checking for libssh2_channel_forward_listen_ex in -lssh2... yes
checking for libssh2_userauth_hostbased_fromfile_ex in -lssh2... yes
checking for libssh2_poll in -lssh2... yes
checking for libssh2_publickey_init in -lssh2... yes
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking for ANSI C header files... yes
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 dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 1966080
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC
checking if cc PIC flag -fPIC works... yes
checking if cc static flag -static works... no
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no


creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h
running: make
/bin/sh /var/tmp/pear-build-root/ssh2-0.11.3/libtool --mode=compile cc  -I. -I/t
mp/.private/root/pear/temp/ssh2 -DPHP_ATOM_INC -I/var/tmp/pear-build-root/ssh2-0
.11.3/include -I/var/tmp/pear-build-root/ssh2-0.11.3/main -I/tmp/.private/root/p
ear/temp/ssh2 -I/usr/include/php/5.3.10 -I/usr/include/php/5.3.10/main -I/usr/in
clude/php/5.3.10/TSRM -I/usr/include/php/5.3.10/Zend -I/usr/include/php/5.3.10/e
xt -I/usr/include/php/5.3.10/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /tmp/.pr
ivate/root/pear/temp/ssh2/ssh2.c -o ssh2.lo
mkdir .libs
 cc -I. -I/tmp/.private/root/pear/temp/ssh2 -DPHP_ATOM_INC -I/var/tmp/pear-build
-root/ssh2-0.11.3/include -I/var/tmp/pear-build-root/ssh2-0.11.3/main -I/tmp/.pr
ivate/root/pear/temp/ssh2 -I/usr/include/php/5.3.10 -I/usr/include/php/5.3.10/ma
in -I/usr/include/php/5.3.10/TSRM -I/usr/include/php/5.3.10/Zend -I/usr/include/
php/5.3.10/ext -I/usr/include/php/5.3.10/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c
/tmp/.private/root/pear/temp/ssh2/ssh2.c  -fPIC -DPIC -o .libs/ssh2.o
/tmp/.private/root/pear/temp/ssh2/ssh2.c: In function 'zif_ssh2_publickey_add':
/tmp/.private/root/pear/temp/ssh2/ssh2.c:1026:4: warning: passing argument 1 of
'_efree' discards qualifiers from pointer target type
/usr/include/php/5.3.10/Zend/zend_alloc.h:60:15: note: expected 'void *' but arg
ument is of type 'const char *'
/tmp/.private/root/pear/temp/ssh2/ssh2.c: In function 'zif_ssh2_publickey_list':
/tmp/.private/root/pear/temp/ssh2/ssh2.c:1085:3: warning: passing argument 4 of
'add_assoc_stringl_ex' discards qualifiers from pointer target type
/usr/include/php/5.3.10/Zend/zend_API.h:363:14: note: expected 'char *' but argu
ment is of type 'const unsigned char *'
/tmp/.private/root/pear/temp/ssh2/ssh2.c:1086:3: warning: passing argument 4 of
'add_assoc_stringl_ex' discards qualifiers from pointer target type
/usr/include/php/5.3.10/Zend/zend_API.h:363:14: note: expected 'char *' but argu
ment is of type 'const unsigned char *'
/bin/sh /var/tmp/pear-build-root/ssh2-0.11.3/libtool --mode=compile cc  -I. -I/t
mp/.private/root/pear/temp/ssh2 -DPHP_ATOM_INC -I/var/tmp/pear-build-root/ssh2-0
.11.3/include -I/var/tmp/pear-build-root/ssh2-0.11.3/main -I/tmp/.private/root/p
ear/temp/ssh2 -I/usr/include/php/5.3.10 -I/usr/include/php/5.3.10/main -I/usr/in
clude/php/5.3.10/TSRM -I/usr/include/php/5.3.10/Zend -I/usr/include/php/5.3.10/e
xt -I/usr/include/php/5.3.10/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /tmp/.pr
ivate/root/pear/temp/ssh2/ssh2_fopen_wrappers.c -o ssh2_fopen_wrappers.lo
 cc -I. -I/tmp/.private/root/pear/temp/ssh2 -DPHP_ATOM_INC -I/var/tmp/pear-build
-root/ssh2-0.11.3/include -I/var/tmp/pear-build-root/ssh2-0.11.3/main -I/tmp/.pr
ivate/root/pear/temp/ssh2 -I/usr/include/php/5.3.10 -I/usr/include/php/5.3.10/ma
in -I/usr/include/php/5.3.10/TSRM -I/usr/include/php/5.3.10/Zend -I/usr/include/
php/5.3.10/ext -I/usr/include/php/5.3.10/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c
/tmp/.private/root/pear/temp/ssh2/ssh2_fopen_wrappers.c  -fPIC -DPIC -o .libs/ss
h2_fopen_wrappers.o
/bin/sh /var/tmp/pear-build-root/ssh2-0.11.3/libtool --mode=compile cc  -I. -I/t
mp/.private/root/pear/temp/ssh2 -DPHP_ATOM_INC -I/var/tmp/pear-build-root/ssh2-0
.11.3/include -I/var/tmp/pear-build-root/ssh2-0.11.3/main -I/tmp/.private/root/p
ear/temp/ssh2 -I/usr/include/php/5.3.10 -I/usr/include/php/5.3.10/main -I/usr/in
clude/php/5.3.10/TSRM -I/usr/include/php/5.3.10/Zend -I/usr/include/php/5.3.10/e
xt -I/usr/include/php/5.3.10/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /tmp/.pr
ivate/root/pear/temp/ssh2/ssh2_sftp.c -o ssh2_sftp.lo
 cc -I. -I/tmp/.private/root/pear/temp/ssh2 -DPHP_ATOM_INC -I/var/tmp/pear-build
-root/ssh2-0.11.3/include -I/var/tmp/pear-build-root/ssh2-0.11.3/main -I/tmp/.pr
ivate/root/pear/temp/ssh2 -I/usr/include/php/5.3.10 -I/usr/include/php/5.3.10/ma
in -I/usr/include/php/5.3.10/TSRM -I/usr/include/php/5.3.10/Zend -I/usr/include/
php/5.3.10/ext -I/usr/include/php/5.3.10/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c
/tmp/.private/root/pear/temp/ssh2/ssh2_sftp.c  -fPIC -DPIC -o .libs/ssh2_sftp.o
/bin/sh /var/tmp/pear-build-root/ssh2-0.11.3/libtool --mode=link cc -DPHP_ATOM_I
NC -I/var/tmp/pear-build-root/ssh2-0.11.3/include -I/var/tmp/pear-build-root/ssh
2-0.11.3/main -I/tmp/.private/root/pear/temp/ssh2 -I/usr/include/php/5.3.10 -I/u
sr/include/php/5.3.10/main -I/usr/include/php/5.3.10/TSRM -I/usr/include/php/5.3
.10/Zend -I/usr/include/php/5.3.10/ext -I/usr/include/php/5.3.10/ext/date/lib  -
DHAVE_CONFIG_H  -g -O2   -o ssh2.la -export-dynamic -avoid-version -prefer-pic -
module -rpath /var/tmp/pear-build-root/ssh2-0.11.3/modules  ssh2.lo ssh2_fopen_w
rappers.lo ssh2_sftp.lo -lssh2
cc -shared  .libs/ssh2.o .libs/ssh2_fopen_wrappers.o .libs/ssh2_sftp.o  -lssh2
-Wl,-soname -Wl,ssh2.so -o .libs/ssh2.so
creating ssh2.la
(cd .libs && rm -f ssh2.la && ln -s ../ssh2.la ssh2.la)
/bin/sh /var/tmp/pear-build-root/ssh2-0.11.3/libtool --mode=install cp ./ssh2.la
 /var/tmp/pear-build-root/ssh2-0.11.3/modules
cp ./.libs/ssh2.so /var/tmp/pear-build-root/ssh2-0.11.3/modules/ssh2.so
cp ./.libs/ssh2.lai /var/tmp/pear-build-root/ssh2-0.11.3/modules/ssh2.la
PATH="$PATH:/sbin" ldconfig -n /var/tmp/pear-build-root/ssh2-0.11.3/modules
----------------------------------------------------------------------
Libraries have been installed in:
   /var/tmp/pear-build-root/ssh2-0.11.3/modules


If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'


See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------


Build complete.
Don't forget to run 'make test'.


running: make INSTALL_ROOT="/var/tmp/pear-build-root/install-ssh2-0.11.3" instal
l
Installing shared extensions:     /var/tmp/pear-build-root/install-ssh2-0.11.3/u
sr/lib/php/5.3.10/extensions/
running: find "/var/tmp/pear-build-root/install-ssh2-0.11.3" | xargs ls -dils
150807   4 drwxr-xr-x 3 root root   4096 Апр 30 11:59 /var/tmp/pear-build-root/i
nstall-ssh2-0.11.3
152047   4 drwxr-xr-x 3 root root   4096 Апр 30 11:59 /var/tmp/pear-build-root/i
nstall-ssh2-0.11.3/usr
152048   4 drwxr-xr-x 3 root root   4096 Апр 30 11:59 /var/tmp/pear-build-root/i
nstall-ssh2-0.11.3/usr/lib
152049   4 drwxr-xr-x 3 root root   4096 Апр 30 11:59 /var/tmp/pear-build-root/i
nstall-ssh2-0.11.3/usr/lib/php
152050   4 drwxr-xr-x 3 root root   4096 Апр 30 11:59 /var/tmp/pear-build-root/i
nstall-ssh2-0.11.3/usr/lib/php/5.3.10
152051   4 drwxr-xr-x 2 root root   4096 Апр 30 11:59 /var/tmp/pear-build-root/i
nstall-ssh2-0.11.3/usr/lib/php/5.3.10/extensions
152046 192 -rwxr-xr-x 1 root root 193532 Апр 30 11:59 /var/tmp/pear-build-root/i
nstall-ssh2-0.11.3/usr/lib/php/5.3.10/extensions/ssh2.so


Build process completed successfully
Installing '/usr/lib/php/5.3.10/extensions/ssh2.so'
install ok: channel://pecl.php.net/ssh2-0.11.3
configuration option "php_ini" is not set to php.ini location
You should add "extension=ssh2.so" to php.ini


Однако:
[root@server ~]# php -m | grep ssh2
[root@server ~]# echo "extension=ssh2.so" > /etc/php/5.3/apache2-mod_php/php.d/ssh2.ini
[root@server ~]# php -m | grep ssh2[root@server ~]#

Но доступ заработал. Огромное спасибо  :)
« Последнее редактирование: 30.04.2012 09:19:21 от kon-dv »
Морфиус на меня обиделся...