Правила форума Гаранты форума
Размещение рекламы AMX-X компилятор

Здравствуйте, гость Вход | Регистрация

Наши новости:

14-дек
24-апр
10-апр
11-апр

2 страниц V   1 2

Установка (сборка) libssh2 ssh2

Статус пользователя f1nik
сообщение 8.2.2012, 12:14
Сообщение #1


Иконка группы

Стаж: 15 лет

Сообщений: 1862
Благодарностей: 932
Полезность: 1010

Товарищи, никак не могу победить данную проблему!!!
Вобщем что имеется:
Centos 6.2 minimal (чистая, все установил с 0, а то при сборке libssh2 и ssh2 наустанавливал всякого Г не знаю нужного или нет)

2 недели бьюсь, никак не могу собрать эти библиотеки, подскажите, как это все собрать и установить, гугл выдает недостатьи для ubuntu и debian, если есть какой то алгоритм, напишите пожалуйста! Если есть ссылка на более менее свежую статью то можно и ее...

Я пытаюсь скомпилить все у меня выдает кучу ошибок при конфигурировании, может что не установил? gcc есть точно, что туда надо еще?

p.s. все это для панельки управления серверами
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   Цитировать сообщение
Статус пользователя binural
сообщение 8.2.2012, 12:35
Сообщение #2


Стаж: 15 лет

Сообщений: 804
Благодарностей: 220
Полезность: 521

какая версия php?
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
Поблагодарили 1 раз
   + Цитировать сообщение
Статус пользователя f1nik
сообщение 8.2.2012, 12:41
Сообщение #3


Иконка группы

Стаж: 15 лет

Сообщений: 1862
Благодарностей: 932
Полезность: 1010

Цитата(binural @ 8.2.2012, 12:35) *
какая версия php?

5.3
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя binural
сообщение 8.2.2012, 12:49
Сообщение #4


Стаж: 15 лет

Сообщений: 804
Благодарностей: 220
Полезность: 521

?)
Мануал как собрать модуль ssh2.so

Код
yum install automake libtool openssl-devel gcc php-devel


Install libssh2 библиотеки
Код
cd /usr/src
wget http://www.libssh2.org/download/libssh2-1.0.tar.gz
tar -zxf libssh2-1.0.tar.gz
cd libssh2-1.0
./configure
make all install
cd /usr/src
rm -Rf libssh2-1.0
rm -f libssh2-1.0.tar.gz


Install ssh2 PHP сам модуль

Код
wget http://pecl.php.net/get/ssh2-0.11.0.tgz

tar -zxf ssh2-0.11.0.tgz

cd ssh2-0.11.0

phpize && ./configure --with-ssh2 && make

cd modules

mv ssh2.so /usr/local/lib/php/extensions/no-debug-non-zts-20060613 ТУТ Путь к модулям для версии ПХП 5.2 !!! в 5.3 по моему может быть другой

cd /usr/lib/php (Путь может отличаться на вашем сервере)

rm -Rf ssh2-0.11.0

rm -f ssh2-0.11.0.tgz



Теперь добавляем в php.ini
строку extension = ssh2.so

Код
vi /usr/local/lib/php.ini (Replace with your Configuration Path)

extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20060613"    ТУТ Путь к модулям для версии ПХП 5.2 !!! в 5.3 по моему может быть другой

extension = ssh2.so



Делаем рестарт апатча

Код
service httpd restart



Потом командой
Код
php -m
список модулей которые установлены


Отредактировал: binural, - 25.12.2012, 15:19
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
Поблагодарили 1 раз
   + Цитировать сообщение
Статус пользователя Fire
сообщение 8.2.2012, 14:55
Сообщение #5


Иконка группы

Стаж: 17 лет

Сообщений: 2201
Благодарностей: 2227
Полезность: 963

Незнаю как сейчас, но раньше под 5.3 нужно было править исходник, ssh2.c


Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя f1nik
сообщение 8.2.2012, 16:35
Сообщение #6


Иконка группы

Стаж: 15 лет

Сообщений: 1862
Благодарностей: 932
Полезность: 1010

binural,
Спасибо за мануал, libssh2 собралась без проблем, а вот ssh2 выдавал ошибку

configure: error: Cannot find php-config. Please use --with-php-config=PATH


убрал строку --with-php-config=/usr/local/php/bin/php-config
все собралось только не знаю правильно ли, к php прицепилось, и как модуль распознается!!!
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя binural
сообщение 8.2.2012, 17:34
Сообщение #7


Стаж: 15 лет

Сообщений: 804
Благодарностей: 220
Полезность: 521

Цитата(f1nik @ 8.2.2012, 16:35) *
binural,
Спасибо за мануал, libssh2 собралась без проблем, а вот ssh2 выдавал ошибку

configure: error: Cannot find php-config. Please use --with-php-config=PATH


убрал строку --with-php-config=/usr/local/php/bin/php-config
все собралось только не знаю правильно ли, к php прицепилось, и как модуль распознается!!!


Код
phpize && ./configure --with-php-config=/usr/local/php/bin/php-config --with-ssh2 && make


Это строка если ты PHP сам собирал, а не устанавливал уже собранные пакеты RPM
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
Поблагодарили 1 раз
   + Цитировать сообщение
Статус пользователя f1nik
сообщение 8.2.2012, 17:45
Сообщение #8


Иконка группы

Стаж: 15 лет

Сообщений: 1862
Благодарностей: 932
Полезность: 1010

Цитата(binural @ 8.2.2012, 17:34) *
Это строка если ты PHP сам собирал, а не устанавливал уже собранные пакеты RPM

ставил rpm.. так что значит все нормально!!!! Спасибо огромное за помощь!!!! Пусть тема останется, думаю придется часто к ней обращаться пока все настрою нормально))))
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя f1nik
сообщение 6.3.2012, 21:53
Сообщение #9


Иконка группы

Стаж: 15 лет

Сообщений: 1862
Благодарностей: 932
Полезность: 1010

Цитата(binural @ 8.2.2012, 12:49) *
?)

Зачем ты все удалил?(((
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя f1nik
сообщение 7.3.2012, 14:24
Сообщение #10


Иконка группы

Стаж: 15 лет

Сообщений: 1862
Благодарностей: 932
Полезность: 1010

binural,
Напиши пожалуйста еще раз все команды по сборке данных пакетов... я не могу вспомнить а ты все удалил....
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя JIokoMoTuB
сообщение 7.3.2012, 14:55
Сообщение #11


Стаж: 16 лет

Сообщений: 2174
Благодарностей: 566
Полезность: 425

https://c-s.net.ua/forum/ipb.html?s=&sh...st&p=266038


Empower isn't phoenix
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
Поблагодарили 1 раз
   + Цитировать сообщение
Статус пользователя binural
сообщение 3.5.2012, 16:41
Сообщение #12


Стаж: 15 лет

Сообщений: 804
Благодарностей: 220
Полезность: 521

хз как удалил(ась)... чуть позже напишу...
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя 3aB}{o3
сообщение 25.12.2012, 14:47
Сообщение #13


Стаж: 18 лет

Сообщений: 2145
Благодарностей: 825
Полезность: 521

Ребят ставлю ssh2 ругается ssh2.c Centos 6 php 5.3.3

Редактирование ssh2.c Результата не дает
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя 3aB}{o3
сообщение 25.12.2012, 14:54
Сообщение #14


Стаж: 18 лет

Сообщений: 2145
Благодарностей: 825
Полезность: 521

Ошибка
Код
[root@v ~]# tar -zxf ssh2-0.11.0.tgz
[root@v ~]# cd ssh2-0.11.0
[root@v ssh2-0.11.0]# phpize && ./configure --with-ssh2 && make
Configuring for:
PHP Api Version:         20090626
Zend Module Api No:      20090626
Zend Extension Api No:   220090626
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 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 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 -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib
checking for PHP extension directory... /usr/lib/php/modules
checking for PHP installed headers prefix... /usr/include/php
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/local
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 a sed that does not truncate output... (cached) /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1966080
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from cc object... ok
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 for dlfcn.h... yes
checking for objdir... .libs
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC -DPIC
checking if cc PIC flag -fPIC -DPIC works... yes
checking if cc static flag -static works... no
checking if cc supports -c -o file.o... yes
checking if cc supports -c -o file.o... (cached) 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
configure: creating ./config.status
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing libtool commands
/bin/sh /root/ssh2-0.11.0/libtool --mode=compile cc  -I. -I/root/ssh2-0.11.0 -DPHP_ATOM_INC -I/root/ssh2-0.11.0/include -I/root/ssh2-0.11.0/main -I/root/ssh2-0.11.0 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/local/include  -DHAVE_CONFIG_H  -g -O2   -c /root/ssh2-0.11.0/ssh2.c -o ssh2.lo
libtool: compile:  cc -I. -I/root/ssh2-0.11.0 -DPHP_ATOM_INC -I/root/ssh2-0.11.0/include -I/root/ssh2-0.11.0/main -I/root/ssh2-0.11.0 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c /root/ssh2-0.11.0/ssh2.c  -fPIC -DPIC -o .libs/ssh2.o
/root/ssh2-0.11.0/ssh2.c:52: error: duplicate Б─≤staticБ─≥
/root/ssh2-0.11.0/ssh2.c: In function Б─≤zif_ssh2_methods_negotiatedБ─≥:
/root/ssh2-0.11.0/ssh2.c:503: warning: passing argument 4 of Б─≤add_assoc_string_exБ─≥ discards qualifiers from pointer target type
/usr/include/php/Zend/zend_API.h:360: note: expected Б─≤char *Б─≥ but argument is of type Б─≤const char *Б─≥
/root/ssh2-0.11.0/ssh2.c:504: warning: passing argument 4 of Б─≤add_assoc_string_exБ─≥ discards qualifiers from pointer target type
/usr/include/php/Zend/zend_API.h:360: note: expected Б─≤char *Б─≥ but argument is of type Б─≤const char *Б─≥
/root/ssh2-0.11.0/ssh2.c:508: warning: passing argument 4 of Б─≤add_assoc_string_exБ─≥ discards qualifiers from pointer target type
/usr/include/php/Zend/zend_API.h:360: note: expected Б─≤char *Б─≥ but argument is of type Б─≤const char *Б─≥
/root/ssh2-0.11.0/ssh2.c:509: warning: passing argument 4 of Б─≤add_assoc_string_exБ─≥ discards qualifiers from pointer target type
/usr/include/php/Zend/zend_API.h:360: note: expected Б─≤char *Б─≥ but argument is of type Б─≤const char *Б─≥
/root/ssh2-0.11.0/ssh2.c:510: warning: passing argument 4 of Б─≤add_assoc_string_exБ─≥ discards qualifiers from pointer target type
/usr/include/php/Zend/zend_API.h:360: note: expected Б─≤char *Б─≥ but argument is of type Б─≤const char *Б─≥
/root/ssh2-0.11.0/ssh2.c:511: warning: passing argument 4 of Б─≤add_assoc_string_exБ─≥ discards qualifiers from pointer target type
/usr/include/php/Zend/zend_API.h:360: note: expected Б─≤char *Б─≥ but argument is of type Б─≤const char *Б─≥
/root/ssh2-0.11.0/ssh2.c:516: warning: passing argument 4 of Б─≤add_assoc_string_exБ─≥ discards qualifiers from pointer target type
/usr/include/php/Zend/zend_API.h:360: note: expected Б─≤char *Б─≥ but argument is of type Б─≤const char *Б─≥
/root/ssh2-0.11.0/ssh2.c:517: warning: passing argument 4 of Б─≤add_assoc_string_exБ─≥ discards qualifiers from pointer target type
/usr/include/php/Zend/zend_API.h:360: note: expected Б─≤char *Б─≥ but argument is of type Б─≤const char *Б─≥
/root/ssh2-0.11.0/ssh2.c:518: warning: passing argument 4 of Б─≤add_assoc_string_exБ─≥ discards qualifiers from pointer target type
/usr/include/php/Zend/zend_API.h:360: note: expected Б─≤char *Б─≥ but argument is of type Б─≤const char *Б─≥
/root/ssh2-0.11.0/ssh2.c:519: warning: passing argument 4 of Б─≤add_assoc_string_exБ─≥ discards qualifiers from pointer target type
/usr/include/php/Zend/zend_API.h:360: note: expected Б─≤char *Б─≥ but argument is of type Б─≤const char *Б─≥
/root/ssh2-0.11.0/ssh2.c: In function Б─≤zif_ssh2_publickey_addБ─≥:
/root/ssh2-0.11.0/ssh2.c:1045: warning: passing argument 1 of Б─≤_efreeБ─≥ discards qualifiers from pointer target type
/usr/include/php/Zend/zend_alloc.h:60: note: expected Б─≤void *Б─≥ but argument is of type Б─≤const char *Б─≥
/root/ssh2-0.11.0/ssh2.c: In function Б─≤zif_ssh2_publickey_listБ─≥:
/root/ssh2-0.11.0/ssh2.c:1104: warning: passing argument 4 of Б─≤add_assoc_stringl_exБ─≥ discards qualifiers from pointer target type
/usr/include/php/Zend/zend_API.h:361: note: expected Б─≤char *Б─≥ but argument is of type Б─≤const unsigned char *Б─≥
/root/ssh2-0.11.0/ssh2.c:1105: warning: passing argument 4 of Б─≤add_assoc_stringl_exБ─≥ discards qualifiers from pointer target type
/usr/include/php/Zend/zend_API.h:361: note: expected Б─≤char *Б─≥ but argument is of type Б─≤const unsigned char *Б─≥
make: *** [ssh2.lo] Error 1
[root@v ssh2-0.11.0]#
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя binural
сообщение 25.12.2012, 15:04
Сообщение #15


Стаж: 15 лет

Сообщений: 804
Благодарностей: 220
Полезность: 521

Установи репозиторий EpeL
Код
rpm -ihv http://mirror.yandex.ru/epel/6/i386/epel-release-6-7.noarch.rpm

Код
yum clean all

Код
yum list | grep -i ^php.*pecl

Спойлер
Код
php-pecl-ssh2.i686                       0.11.0-7.el6                   @epel
php-pear-CodeGen-PECL.noarch             1.1.3-3.el6                    epel
php-pecl-amqp.i686                       1.0.1-3.el6                    epel
php-pecl-apc.i686                        3.1.9-2.el6                    base
php-pecl-apc-devel.i686                  3.1.9-2.el6                    base
php-pecl-cairo.i686                      0.3.2-2.el6                    epel
php-pecl-cairo-devel.i686                0.3.2-2.el6                    epel
php-pecl-fileinfo.i686                   1.0.4-2.el6.rf                 rpmforge
php-pecl-geoip.i686                      1.0.8-3.el6                    epel
php-pecl-gmagick.i686                    1.1.0-0.2.RC2.el6              epel
php-pecl-http.i686                       1.6.5-2.el6.rf                 rpmforge
php-pecl-igbinary.i686                   1.1.1-3.el6                    epel
php-pecl-igbinary-devel.i686             1.1.1-3.el6                    epel
php-pecl-imagick.i686                    2.2.2-4.el6                    epel
php-pecl-lzf.i686                        1.6.2-2.el6                    epel
php-pecl-mailparse.i686                  2.1.5-2.el6.rf                 rpmforge
php-pecl-memcache.i686                   3.0.5-4.el6                    base
php-pecl-memcached.i686                  1.0.0-1.el6                    epel
php-pecl-mongo.i686                      1.2.12-1.el6                   epel
php-pecl-ncurses.i686                    1.0.1-1.el6                    epel
php-pecl-oauth.i686                      1.2.3-1.el6                    epel
php-pecl-parsekit.i686                   1.2-5.CVS20090309.el6          epel
php-pecl-radius.i686                     1.2.5-10.el6                   epel
php-pecl-rrd.i686                        1.0.3-1.el6                    epel
php-pecl-runkit.i686                     0.9-12.CVS20090215.el6         epel
php-pecl-session_mysql.i686              1.9-2.el6.rf                   rpmforge
php-pecl-solr.i686                       0.9.11-1.el6                   epel
php-pecl-sphinx.i686                     1.0.0-2.el6                    epel
php-pecl-uuid.i686                       1.0.3-3.el6                    epel
php-pecl-xdebug.i686                     2.1.4-1.el6                    epel
php-pecl-xhprof.i686                     0.9.2-5.el6                    epel

Код
yum install php-pecl-ssh2

Код
service httpd restart


Какая архитектура ОС?

Отредактировал: binural, - 25.12.2012, 15:32
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
Поблагодарили 1 раз
   + Цитировать сообщение
Статус пользователя 3aB}{o3
сообщение 25.12.2012, 15:12
Сообщение #16


Стаж: 18 лет

Сообщений: 2145
Благодарностей: 825
Полезность: 521

32 i386
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя 3aB}{o3
сообщение 25.12.2012, 15:37
Сообщение #17


Стаж: 18 лет

Сообщений: 2145
Благодарностей: 825
Полезность: 521

в php.ini прописывать нужно что то ?

php -m
[root@v ~]# php -m
[PHP Modules]
bz2
calendar
Core
ctype
curl
date
ereg
exif
fileinfo
filter
ftp
gettext
gmp
hash
iconv
ionCube Loader
json
libxml
openssl
pcntl
pcre
Phar
readline
Reflection
session
shmop
SimpleXML
sockets
SPL
ssh2
standard
tokenizer
xml
Zend Guard Loader
zip
zlib

[Zend Modules]
Zend Guard Loader
the ionCube PHP Loader
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя binural
сообщение 25.12.2012, 15:44
Сообщение #18


Стаж: 15 лет

Сообщений: 804
Благодарностей: 220
Полезность: 521

А ты не видишь что в списке подключен модуль ssh2
Проверь установлена ли библиотека libssh2
Код
yum install libssh2
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя 3aB}{o3
сообщение 25.12.2012, 15:46
Сообщение #19


Стаж: 18 лет

Сообщений: 2145
Благодарностей: 825
Полезность: 521

Цитата(binural @ 25.12.2012, 17:44) *
А ты не видишь что в списке подключен модуль ssh2
Проверь установлена ли библиотека libssh2
Код
yum install libssh2


Код
Package libssh2-1.2.2-11.el6_3.i686 already installed and latest version
Nothing to do
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя binural
сообщение 25.12.2012, 15:48
Сообщение #20


Стаж: 15 лет

Сообщений: 804
Благодарностей: 220
Полезность: 521

Значит все готово =))
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
Поблагодарили 1 раз
   + Цитировать сообщение
2 страниц V   1 2
 
Тема закрытаНачать новую тему
 
0 пользователей и 1 гостей читают эту тему: