Installing SSH2 Problem

Support for webhosts that use CentOS
Post Reply
jmgc92
Posts: 2
Joined: 2011/11/12 15:11:05
Contact:

Installing SSH2 Problem

Post by jmgc92 » 2011/11/12 15:22:00

Hi Guys im really new with Centos is my first time in linux but im going so so,

well my problem is this im trying to installing SSH2 for some PHP APP who need it,

I installed OpenSSl as you can see:
[code][root@admin ssh2-0.10]# rpm -qa |grep openssl
openssl-0.9.8e-20.el5
openssl-devel-0.9.8e-20.el5
openssl-0.9.8e-20.el5
[root@admin ssh2-0.10]#[/code]

also i installed libssh2.

But the problem come here when i try to install module (http://pecl.php.net/get/ssh2-0.10.tgz)
i use the follow command

[code][root@box1 ~]# tar -xzf ssh2-0.10.tgz
[root@box1 ~]# cd ssh2-0.10
phpize
./configure --with-ssh2
[/code]

Everthing right but when i use make i get this error:

[quote]/usr/include/php/Zend/zend_alloc.h:247: error: expected declaration specifiers or '...' before 'size_t' /usr/include/php/Zend/zend_alloc.h:252: warning: parameter names (without types) in function declaration /usr/include/php/Zend/zend_alloc.h:254: error: expected declaration specifiers or '...' before 'size_t' In file included from /usr/include/php/Zend/zend.h:270, from /usr/include/php/main/php.h:35, from /root/tmp/ssh2-0.10/ssh2.c:23: /usr/include/php/Zend/zend_hash.h:47: error: expected declaration specifiers or '...' before 'size_t' In file included from /usr/include/php/Zend/zend.h:272, from /usr/include/php/main/php.h:35, from /root/tmp/ssh2-0.10/ssh2.c:23: /usr/include/php/Zend/zend_llist.h:40: error: expected specifier-qualifier-list before 'size_t' /usr/include/php/Zend/zend_llist.h:50: error: expected declaration specifiers or '...' before 'size_t' In file included from /usr/include/php/Zend/zend.h:472, from /usr/include/php/main/php.h:35, from /root/tmp/ssh2-0.10/ssh2.c:23: /usr/include/php/Zend/zend_stream.h:30: error: expected declaration specifiers or '...' before '*' token /usr/include/php/Zend/zend_stream.h:30: error: 'size_t' declared as function returning a function /usr/include/php/Zend/zend_stream.h:31: error: 'zend_stream_reader_t' declared as function returning a function /usr/include/php/Zend/zend_stream.h:45: error: field 'len' declared as a function /usr/include/php/Zend/zend_stream.h:46: error: field 'pos' declared as a function /usr/include/php/Zend/zend_stream.h:58: error: expected specifier-qualifier-list before 'zend_stream_fsizer_t' In file included from /usr/include/php/Zend/zend.h:755, from /usr/include/php/main/php.h:35, from /root/tmp/ssh2-0.10/ssh2.c:23: /usr/include/php/Zend/zend_operators.h: In function 'is_numeric_string': /usr/include/php/Zend/zend_operators.h:201: warning: incompatible implicit declaration of built-in function 'strlen' /usr/include/php/Zend/zend_operators.h:201: error: invalid lvalue in assignment /usr/include/php/Zend/zend_operators.h:201: error: invalid lvalue in assignment /usr/include/php/Zend/zend_operators.h:201: error: cast specifies function type /usr/include/php/Zend/zend_operators.h:201: error: cast specifies function type /usr/include/php/Zend/zend_operators.h:201: warning: comparison between pointer and integer /usr/include/php/Zend/zend_operators.h:201: error: cast specifies function type /usr/include/php/Zend/zend_operators.h:201: error: cast specifies function type /usr/include/php/Zend/zend_operators.h:201: warning: comparison between pointer and integer /usr/include/php/Zend/zend_operators.h:201: error: cast specifies function type /usr/include/php/Zend/zend_operators.h:201: error: cast specifies function type /usr/include/php/Zend/zend_operators.h:201: error: invalid lvalue in assignment /usr/include/php/Zend/zend_operators.h:201: warning: comparison between pointer and integer /usr/include/php/Zend/zend_operators.h:201: error: cast specifies function type /usr/include/php/Zend/zend_operators.h:201: error: cast specifies function type /usr/include/php/Zend/zend_operators.h:201: warning: comparison between pointer and integer /usr/include/php/Zend/zend_operators.h:201: warning: comparison between pointer and integer /usr/include/php/Zend/zend_operators.h:201: error: cast specifies function type /usr/include/php/Zend/zend_operators.h:201: error: cast specifies function type /usr/include/php/Zend/zend_operators.h:201: error: invalid lvalue in assignment /usr/include/php/Zend/zend_operators.h:201: warning: comparison between pointer and integer /usr/include/php/Zend/zend_operators.h:201: error: cast specifies function type /usr/include/php/Zend/zend_operators.h:201: error: cast specifies function type /usr/include/php/Zend/zend_operators.h:201: warning: comparison between pointer and integer /usr/include/php/Zend/zend_operators.h:201: warning: comparison between pointer and integer /usr/include/php/Zend/zend_operators.h: In function 'zend_memnstr': /usr/include/php/Zend/zend_operators.h:233: error: too many arguments to function 'memchr' /usr/include/php/Zend/zend_operators.h:243: error: too many arguments to function 'memchr' /usr/include/php/Zend/zend_operators.h:244: error: too many arguments to function 'memcmp' /usr/include/php/Zend/zend_operators.h: In function 'zend_memrchr': /usr/include/php/Zend/zend_operators.h:267: error: invalid operands to binary + In file included from /usr/include/php/Zend/zend_globals.h:31, from /usr/include/php/Zend/zend_compile.h:342, from /usr/include/php/Zend/zend_modules.h:26, from /usr/include/php/Zend/zend_API.h:26, from /usr/include/php/main/php.h:39, from /root/tmp/ssh2-0.10/ssh2.c:23: /usr/include/php/Zend/zend_ptr_stack.h: In function 'zend_ptr_stack_3_push': /usr/include/php/Zend/zend_ptr_stack.h:61: error: too many arguments to function '__zend_realloc' /usr/include/php/Zend/zend_ptr_stack.h:61: error: too many arguments to function '_erealloc' /usr/include/php/Zend/zend_ptr_stack.h: In function 'zend_ptr_stack_2_push': /usr/include/php/Zend/zend_ptr_stack.h:75: error: too many arguments to function '__zend_realloc' /usr/include/php/Zend/zend_ptr_stack.h:75: error: too many arguments to function '_erealloc' /usr/include/php/Zend/zend_ptr_stack.h: In function 'zend_ptr_stack_push': /usr/include/php/Zend/zend_ptr_stack.h:101: error: too many arguments to function '__zend_realloc' /usr/include/php/Zend/zend_ptr_stack.h:101: error: too many arguments to function '_erealloc' In file included from /usr/include/php/Zend/zend_modules.h:26, from /usr/include/php/Zend/zend_API.h:26, from /usr/include/php/main/php.h:39, from /root/tmp/ssh2-0.10/ssh2.c:23: /usr/include/php/Zend/zend_compile.h: At top level: /usr/include/php/Zend/zend_compile.h:361: error: 'zend_get_scanned_file_offset' declared as function returning a function /usr/include/php/Zend/zend_compile.h:608: error: 'zend_dirname' declared as function returning a function In file included from /usr/include/php/Zend/zend_API.h:26, from /usr/include/php/main/php.h:39, from /root/tmp/ssh2-0.10/ssh2.c:23: /usr/include/php/Zend/zend_modules.h:88: error: field 'globals_size' declared as a function In file included from /usr/include/php/Zend/zend_API.h:30, from /usr/include/php/main/php.h:39, from /root/tmp/ssh2-0.10/ssh2.c:23: /usr/include/php/Zend/zend_execute.h: In function 'zend_vm_stack_new_page': /usr/include/php/Zend/zend_execute.h:163: warning: cast to pointer from integer of different size /usr/include/php/Zend/zend_execute.h: In function 'zend_vm_stack_alloc': /usr/include/php/Zend/zend_execute.h:226: error: invalid operands to binary / /usr/include/php/Zend/zend_execute.h:232: warning: comparison between pointer and integer /usr/include/php/Zend/zend_execute.h:234: warning: passing argument 1 of 'zend_vm_stack_extend' makes integer from pointer without a cast /usr/include/php/Zend/zend_execute.h:244: warning: cast from pointer to integer of different size /usr/include/php/Zend/zend_execute.h:244: warning: cast from pointer to integer of different size /usr/include/php/Zend/zend_execute.h:247: error: invalid operands to binary + In file included from /usr/include/php/main/php.h:39, from /root/tmp/ssh2-0.10/ssh2.c:23: /usr/include/php/Zend/zend_API.h: At top level: /usr/include/php/Zend/zend_API.h:44: error: field 'size' declared as a function In file included from /root/tmp/ssh2-0.10/ssh2.c:23: /usr/include/php/main/php.h:130: error: 'php_strlcpy' declared as function returning a function /usr/include/php/main/php.h:138: error: 'php_strlcat' declared as function returning a function In file included from /usr/include/php/main/php.h:167, from /root/tmp/ssh2-0.10/ssh2.c:23: /usr/include/unistd.h:568: error: 'confstr' declared as function returning a function In file included from /usr/include/php/main/php_streams.h:103, from /usr/include/php/main/php.h:406, from /root/tmp/ssh2-0.10/ssh2.c:23: /usr/include/php/main/streams/php_stream_context.h:50: error: field 'progress' declared as a function /usr/include/php/main/streams/php_stream_context.h:50: error: field 'progress_max' declared as a function In file included from /usr/include/php/main/php_streams.h:104, from /usr/include/php/main/php.h:406, from /root/tmp/ssh2-0.10/ssh2.c:23: /usr/include/php/main/streams/php_stream_filter_api.h:49: error: field 'buflen' declared as a function In file included from /usr/include/php/main/php.h:406, from /root/tmp/ssh2-0.10/ssh2.c:23: /usr/include/php/main/php_streams.h:118: error: 'write' declared as function returning a function /usr/include/php/main/php_streams.h:119: error: 'read' declared as function returning a function /usr/include/php/main/php_streams.h:218: error: field 'readbuflen' declared as a function /usr/include/php/main/php_streams.h:223: error: field 'chunk_size' declared as a function /usr/include/php/main/php_streams.h:288: error: '_php_stream_read' declared as function returning a function /usr/include/php/main/php_streams.h:291: error: '_php_stream_write' declared as function returning a function /usr/include/php/main/php_streams.h:298: error: '_php_stream_printf' declared as function returning a function /usr/include/php/main/php_streams.h:430: error: '_php_stream_copy_to_stream' declared as function returning a function /usr/include/php/main/php_streams.h:432: error: '_php_stream_copy_to_stream_ex' declared as function returning a function /usr/include/php/main/php_streams.h:439: error: '_php_stream_copy_to_mem' declared as function returning a function /usr/include/php/main/php_streams.h:443: error: '_php_stream_passthru' declared as function returning a function In file included from /usr/include/sys/uio.h:29, from /usr/include/sys/socket.h:27, from /usr/include/php/main/streams/php_stream_transport.h:26, from /usr/include/php/main/php_streams.h:447, from /usr/include/php/main/php.h:406, from /root/tmp/ssh2-0.10/ssh2.c:23: /usr/include/bits/uio.h:47: error: field 'iov_len' declared as a function In file included from /usr/include/sys/socket.h:35, from /usr/include/php/main/streams/php_stream_transport.h:26, from /usr/include/php/main/php_streams.h:447, from /usr/include/php/main/php.h:406, from /root/tmp/ssh2-0.10/ssh2.c:23: /usr/include/bits/socket.h:221: error: field 'msg_iovlen' declared as a function /usr/include/bits/socket.h:224: error: field 'msg_controllen' declared as a function /usr/include/bits/socket.h:235: error: field 'cmsg_len' declared as a function /usr/include/bits/socket.h: In function '__cmsg_nxthdr': /usr/include/bits/socket.h:272: error: cast specifies function type /usr/include/bits/socket.h:277: error: cast specifies function type /usr/include/bits/socket.h:279: error: invalid operands to binary + /usr/include/bits/socket.h:280: error: cast specifies function type /usr/include/bits/socket.h:281: error: invalid operands to binary + In file included from /usr/include/php/main/php_streams.h:447, from /usr/include/php/main/php.h:406, from /root/tmp/ssh2-0.10/ssh2.c:23: /usr/include/php/main/streams/php_stream_transport.h: At top level: /usr/include/php/main/streams/php_stream_transport.h:150: error: field 'buflen' declared as a function In file included from /usr/include/php/main/php_streams.h:451, from /usr/include/php/main/php.h:406, from /root/tmp/ssh2-0.10/ssh2.c:23: /usr/include/php/main/streams/php_stream_mmap.h:51: error: field 'offset' declared as a function /usr/include/php/main/streams/php_stream_mmap.h:52: error: field 'length' declared as a function In file included from /usr/include/php/main/php_reentrancy.h:30, from /usr/include/php/main/php.h:421, from /root/tmp/ssh2-0.10/ssh2.c:23: /usr/include/time.h:202: error: 'strftime' declared as function returning a function /usr/include/time.h:221: error: 'strftime_l' declared as function returning a function In file included from /root/tmp/ssh2-0.10/php_ssh2.h:24, from /root/tmp/ssh2-0.10/ssh2.c:25: /usr/local/include/libssh2.h:1031: error: field 'blob_len' declared as a function In file included from /root/tmp/ssh2-0.10/php_ssh2.h:25, from /root/tmp/ssh2-0.10/ssh2.c:25: /usr/local/include/libssh2_sftp.h:260: error: 'libssh2_sftp_tell' declared as function returning a function In file included from /root/tmp/ssh2-0.10/ssh2.c:26: /usr/include/php/main/php_network.h:273: error: field 'ownsize' declared as a function /root/tmp/ssh2-0.10/ssh2.c:49: error: duplicate 'static' /root/tmp/ssh2-0.10/ssh2.c: In function 'php_ssh2_alloc_cb': /root/tmp/ssh2-0.10/ssh2.c:71: warning: return makes pointer from integer without a cast /root/tmp/ssh2-0.10/ssh2.c: In function 'php_ssh2_realloc_cb': /root/tmp/ssh2-0.10/ssh2.c:89: warning: passing argument 2 of '_erealloc' makes integer from pointer without a cast /root/tmp/ssh2-0.10/ssh2.c:89: error: too many arguments to function '_erealloc' /root/tmp/ssh2-0.10/ssh2.c: In function 'php_ssh2_debug_cb': /root/tmp/ssh2-0.10/ssh2.c:111: warning: cast to pointer from integer of different size /root/tmp/ssh2-0.10/ssh2.c:115: warning: cast to pointer from integer of different size /root/tmp/ssh2-0.10/ssh2.c:119: warning: cast to pointer from integer of different size /root/tmp/ssh2-0.10/ssh2.c: In function 'php_ssh2_ignore_cb': /root/tmp/ssh2-0.10/ssh2.c:150: warning: cast to pointer from integer of different size /root/tmp/ssh2-0.10/ssh2.c: In function 'php_ssh2_macerror_cb': /root/tmp/ssh2-0.10/ssh2.c:184: warning: cast to pointer from integer of different size /root/tmp/ssh2-0.10/ssh2.c: In function 'php_ssh2_disconnect_cb': /root/tmp/ssh2-0.10/ssh2.c:220: warning: cast to pointer from integer of different size /root/tmp/ssh2-0.10/ssh2.c:224: warning: cast to pointer from integer of different size /root/tmp/ssh2-0.10/ssh2.c:228: warning: cast to pointer from integer of different size /root/tmp/ssh2-0.10/ssh2.c: In function 'php_ssh2_set_callback': /root/tmp/ssh2-0.10/ssh2.c:261: warning: cast to pointer from integer of different size /root/tmp/ssh2-0.10/ssh2.c: In function 'php_ssh2_session_connect': /root/tmp/ssh2-0.10/ssh2.c:346: warning: assignment makes pointer from integer without a cast /root/tmp/ssh2-0.10/ssh2.c: In function 'zif_ssh2_methods_negotiated': /root/tmp/ssh2-0.10/ssh2.c:483: warning: assignment discards qualifiers from pointer target type /root/tmp/ssh2-0.10/ssh2.c:484: warning: assignment discards qualifiers from pointer target type /root/tmp/ssh2-0.10/ssh2.c:485: warning: assignment discards qualifiers from pointer target type /root/tmp/ssh2-0.10/ssh2.c:486: warning: assignment discards qualifiers from pointer target type /root/tmp/ssh2-0.10/ssh2.c:487: warning: assignment discards qualifiers from pointer target type /root/tmp/ssh2-0.10/ssh2.c:488: warning: assignment discards qualifiers from pointer target type /root/tmp/ssh2-0.10/ssh2.c:489: warning: assignment discards qualifiers from pointer target type /root/tmp/ssh2-0.10/ssh2.c:490: warning: assignment discards qualifiers from pointer target type /root/tmp/ssh2-0.10/ssh2.c:491: warning: assignment discards qualifiers from pointer target type /root/tmp/ssh2-0.10/ssh2.c:492: warning: assignment discards qualifiers from pointer target type /root/tmp/ssh2-0.10/ssh2.c:496: warning: incompatible implicit declaration of built-in function 'strlen' /root/tmp/ssh2-0.10/ssh2.c:499: warning: cast to pointer from integer of different size /root/tmp/ssh2-0.10/ssh2.c:507: warning: cast to pointer from integer of different size /root/tmp/ssh2-0.10/ssh2.c: In function 'zif_ssh2_fingerprint': /root/tmp/ssh2-0.10/ssh2.c:536: warning: assignment discards qualifiers from pointer target type /root/tmp/ssh2-0.10/ssh2.c:555: warning: assignment makes pointer from integer without a cast /root/tmp/ssh2-0.10/ssh2.c:557: warning: passing argument 2 of 'ap_php_snprintf' makes pointer from integer without a cast /root/tmp/ssh2-0.10/ssh2.c: In function 'zif_ssh2_auth_none': /root/tmp/ssh2-0.10/ssh2.c:594: warning: incompatible implicit declaration of built-in function 'strlen' /root/tmp/ssh2-0.10/ssh2.c: In function 'zif_ssh2_forward_listen': /root/tmp/ssh2-0.10/ssh2.c:750: warning: assignment makes pointer from integer without a cast /root/tmp/ssh2-0.10/ssh2.c: In function 'zif_ssh2_forward_accept': /root/tmp/ssh2-0.10/ssh2.c:783: warning: assignment makes pointer from integer without a cast /root/tmp/ssh2-0.10/ssh2.c: In function 'zif_ssh2_poll': /root/tmp/ssh2-0.10/ssh2.c:833: warning: assignment makes pointer from integer without a cast /root/tmp/ssh2-0.10/ssh2.c:834: warning: assignment makes pointer from integer without a cast /root/tmp/ssh2-0.10/ssh2.c:885: error: 'zval' has no member named 'is_ref' /root/tmp/ssh2-0.10/ssh2.c:885: error: 'zval' has no member named 'refcount' /root/tmp/ssh2-0.10/ssh2.c:887: warning: cast to pointer from integer of different size /root/tmp/ssh2-0.10/ssh2.c:895: error: 'zval' has no member named 'is_ref' /root/tmp/ssh2-0.10/ssh2.c:896: error: 'zval' has no member named 'refcount' /root/tmp/ssh2-0.10/ssh2.c:899: warning: incompatible implicit declaration of built-in function 'strlen' /root/tmp/ssh2-0.10/ssh2.c: In function 'zif_ssh2_publickey_init': /root/tmp/ssh2-0.10/ssh2.c:941: warning: assignment makes pointer from integer without a cast /root/tmp/ssh2-0.10/ssh2.c: In function 'zif_ssh2_publickey_add': /root/tmp/ssh2-0.10/ssh2.c:975: warning: assignment makes pointer from integer without a cast /root/tmp/ssh2-0.10/ssh2.c:1005: error: 'zval' has no member named 'is_ref' /root/tmp/ssh2-0.10/ssh2.c:1006: error: 'zval' has no member named 'refcount' /root/tmp/ssh2-0.10/ssh2.c:1038: warning: passing argument 1 of '_efree' discards qualifiers from pointer target type /root/tmp/ssh2-0.10/ssh2.c: In function 'zif_ssh2_publickey_list': /root/tmp/ssh2-0.10/ssh2.c:1094: warning: cast to pointer from integer of different size /root/tmp/ssh2-0.10/ssh2.c:1097: warning: incompatible implicit declaration of built-in function 'strlen' /root/tmp/ssh2-0.10/ssh2.c:1097: warning: passing argument 4 of 'add_assoc_stringl_ex' discards qualifiers from pointer target type /root/tmp/ssh2-0.10/ssh2.c:1098: warning: passing argument 4 of 'add_assoc_stringl_ex' discards qualifiers from pointer target type /root/tmp/ssh2-0.10/ssh2.c:1100: warning: cast to pointer from integer of different size /root/tmp/ssh2-0.10/ssh2.c:1105: warning: cast to pointer from integer of different size make: *** [ssh2.lo] Error 1[/quote]

someone could help me? thanks

[Moderator edited to replace the [i]code[/i] tags with [i]quote[/i] tags, thus alleviating the "off the RH side of the screen" effect.]

jmgc92
Posts: 2
Joined: 2011/11/12 15:11:05
Contact:

Installing SSH2 Problem

Post by jmgc92 » 2011/11/12 15:39:50

Slove the problem as you can see here

[code][root@admin ssh2-0.10]# php -m | grep ssh2
ssh2[/code]

---------------------------------

The best way to install it is this:

Installing the SSH2 PHP extension on CentOS is actually pretty simple. Although it isn’t available as a straight yum install, it boils down to a few short steps.
Firstly, we’re going to install the dependencies:

[code]yum install gcc php-devel php-pear libssh2 libssh2-devel[/code]

These will allow us to build the SSH2 extension using pecl.

[code]pecl install -f ssh2[/code]

After running that command, it should stop at a line like:

[code]..
........done: 22,740 bytes
5 source files, building
running: phpize Configuring for:
PHP Api Version: 20041225
Zend Module Api No: 20060613
Zend Extension Api No: 220060519 l
ibssh2 prefix? [autodetect] :[/code]

All you have to do is hit Enter and it should detect the proper path. Once the install is completed, you just have to tell PHP to load the extension when it boots.

[code]touch /etc/php.d/ssh2.ini
echo extension=ssh2.so > /etc/php.d/ssh2.ini[/code]

You should add "extension=ssh2.so" to php.ini

Now restart your webserver and test to see if the changes took effect.

[code]/etc/init.d/httpd restart php -m | grep
ssh2[/code]

You should get a line returned with ’ssh2′.

More easy

Post Reply

Return to “CentOS 5 - Webhosting Support”