php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57853 compiling problem
Submitted: 2007-09-27 14:03 UTC Modified: 2008-12-21 11:05 UTC
From: sam dot shull at jhspecialty dot com Assigned:
Status: Closed Package: ssh2 (PECL)
PHP Version: 5.2.1 OS: OpenSuSe
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: sam dot shull at jhspecialty dot com
New email:
PHP Version: OS:

 

 [2007-09-27 14:03 UTC] sam dot shull at jhspecialty dot com
Description:
------------
When trying to install compile fails. Previous instruction in bug 4756 and bug 5408
does not fix the issue - results produced are identical after
instructions are followed. This is true with ssh2-0.7 through ssh2-0.9
at the very least.

Configure Command 
'./configure' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-gettext' '--enable-dbase' '--with-mssql=/usr/local/freetds' '--with-ldap' '--with-mysqli' '--with-gd'

Reproduce code:
---------------
pecl install ssh2-beta
pear install ssh2-beta
pecl install -f ssh2
or
download source and extract
phpize && ./configure --with-ssh2 && make

Expected result:
----------------
Successful compilation of module.

Actual result:
--------------
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... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/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 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/local
checking for PHP includes... -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/lib/php/extensions/no-debug-non-zts-20060613
checking for PHP installed headers prefix... /usr/local/include/php
checking for re2c... no
configure: WARNING: You will need re2c 0.9.11 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 ld used by gcc... /usr/i586-suse-linux/bin/ld
checking if the linker (/usr/i586-suse-linux/bin/ld) is GNU ld... yes
checking for /usr/i586-suse-linux/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 recognise dependent libraries... pass_all
checking how to run the C preprocessor... gcc -E
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 for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -E
checking the maximum length of command line arguments... 32768
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if gcc static flag  works... yes
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC
checking if gcc PIC flag -fPIC works... yes
checking if gcc supports -c -o file.o... yes
checking whether the gcc linker (/usr/i586-suse-linux/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
checking for ld used by g++... /usr/i586-suse-linux/bin/ld
checking if the linker (/usr/i586-suse-linux/bin/ld) is GNU ld... yes
checking whether the g++ linker (/usr/i586-suse-linux/bin/ld) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC
checking if g++ PIC flag -fPIC works... yes
checking if g++ supports -c -o file.o... yes
checking whether the g++ linker (/usr/i586-suse-linux/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
configure: creating ./config.status
config.status: creating config.h
config.status: config.h is unchanged
/bin/sh /tmp/pear/cache/ssh2-0.10/libtool --mode=compile gcc  -I. -I/tmp/pear/cache/ssh2-0.10 -DPHP_ATOM_INC -I/tmp/pear/cache/ssh2-0.10/include -I/tmp/pear/cache/ssh2-0.10/main -I/tmp/pear/cache/ssh2-0.10 -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/local/include  -I/usr/kerberos/include/ -DHAVE_CONFIG_H  -g -O2   -c /tmp/pear/cache/ssh2-0.10/ssh2.c -o ssh2.lo
mkdir .libs
 gcc -I. -I/tmp/pear/cache/ssh2-0.10 -DPHP_ATOM_INC -I/tmp/pear/cache/ssh2-0.10/include -I/tmp/pear/cache/ssh2-0.10/main -I/tmp/pear/cache/ssh2-0.10 -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/local/include -I/usr/kerberos/include/ -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/cache/ssh2-0.10/ssh2.c  -fPIC -DPIC -o .libs/ssh2.o
/tmp/pear/cache/ssh2-0.10/ssh2.c: In function ?zif_ssh2_methods_negotiated?:
/tmp/pear/cache/ssh2-0.10/ssh2.c:482: warning: passing argument 2 of ?libssh2_session_methods? makes integer from pointer without a cast
/tmp/pear/cache/ssh2-0.10/ssh2.c:482: error: too many arguments to function ?libssh2_session_methods?
/tmp/pear/cache/ssh2-0.10/ssh2.c: In function ?zif_ssh2_fingerprint?:
/tmp/pear/cache/ssh2-0.10/ssh2.c:537: warning: assignment discards qualifiers from pointer target type
/tmp/pear/cache/ssh2-0.10/ssh2.c: In function ?zif_ssh2_publickey_add?:
/tmp/pear/cache/ssh2-0.10/ssh2.c:1039: warning: passing argument 1 of ?_efree? discards qualifiers from pointer target type
/tmp/pear/cache/ssh2-0.10/ssh2.c: In function ?zif_ssh2_publickey_list?:
/tmp/pear/cache/ssh2-0.10/ssh2.c:1098: warning: passing argument 4 of ?add_assoc_stringl_ex? discards qualifiers from pointer target type
/tmp/pear/cache/ssh2-0.10/ssh2.c:1099: warning: passing argument 4 of ?add_assoc_stringl_ex? discards qualifiers from pointer target type
/tmp/pear/cache/ssh2-0.10/ssh2.c:1107: warning: initialization discards qualifiers from pointer target type
/tmp/pear/cache/ssh2-0.10/ssh2.c:1108: warning: passing argument 2 of ?_zend_hash_add_or_update? discards qualifiers from pointer target type
make: *** [ssh2.lo] Error 1


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-10-02 09:03 UTC] ciskas at gmail dot com
The same error with SuSE SLES 10.
...
...
 gcc -I. -I/tmp/pear/download/ssh2-0.10 -DPHP_ATOM_INC -I/var/tmp/pear-build-andrius/ssh2-0.10/include -I/var/tmp/pear-build-andrius/ssh2-0.10/main -I/tmp/pear/download/ssh2-0.10 -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/local/include -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/download/ssh2-0.10/ssh2.c  -fPIC -DPIC -o .libs/ssh2.o
/tmp/pear/download/ssh2-0.10/ssh2.c: In function 'zif_ssh2_methods_negotiated':
/tmp/pear/download/ssh2-0.10/ssh2.c:481: warning: passing argument 2 of 'libssh2_session_methods' makes integer from pointer without a cast
/tmp/pear/download/ssh2-0.10/ssh2.c:481: error: too many arguments to function 'libssh2_session_methods'
/tmp/pear/download/ssh2-0.10/ssh2.c: In function 'zif_ssh2_fingerprint':
/tmp/pear/download/ssh2-0.10/ssh2.c:536: warning: assignment discards qualifiers from pointer target type
/tmp/pear/download/ssh2-0.10/ssh2.c: In function 'zif_ssh2_publickey_add':
/tmp/pear/download/ssh2-0.10/ssh2.c:1038: warning: passing argument 1 of '_efree' discards qualifiers from pointer target type
/tmp/pear/download/ssh2-0.10/ssh2.c: In function 'zif_ssh2_publickey_list':
/tmp/pear/download/ssh2-0.10/ssh2.c:1097: warning: passing argument 4 of 'add_assoc_stringl_ex' discards qualifiers from pointer target type
/tmp/pear/download/ssh2-0.10/ssh2.c:1098: warning: passing argument 4 of 'add_assoc_stringl_ex' discards qualifiers from pointer target type
/tmp/pear/download/ssh2-0.10/ssh2.c:1106: warning: initialization discards qualifiers from pointer target type
/tmp/pear/download/ssh2-0.10/ssh2.c:1107: warning: passing argument 2 of '_zend_hash_add_or_update' discards qualifiers from pointer target type
make: *** [ssh2.lo] Error 1
ERROR: `make' failed
 [2007-10-11 05:43 UTC] ciskas at gmail dot com
I resolved SSH2 compilation problem.
You need to use older libssh2 (2005-). I used libssh2 v0.12 and ssh2 pecl compiled on SLES10 fine.
 [2008-05-08 10:18 UTC] volkirik at yahoo dot com dot tr
ssh2.c patch:


LINE 480:
search and change following line:
#if LIBSSH2_APINO < 200412301450
...
#else

to:
#if (defined(LIBSSH2_APINO) && LIBSSH2_APINO < 200412301450)
...
#else /* if LIBSSH2_APINO is not defined its v0.14 or higher. no problem! */

LINE 1216:
search and change following line:
#if (LIBSSH2_APINO > 200503221619)

to:
#if (defined(LIBSSH2_APINO) && (LIBSSH2_APINO > 200503221619)) || (defined(LIBSSH2_VERSION_NUM) && LIBSSH2_VERSION_NUM >= 0x001000)

Compile Again with latest libssh2

----
Volkan K.
 [2008-12-21 11:05 UTC] mikesul@php.net
Thank you for your bug report. This issue has been fixed
in the latest released version of the package, which you can download at
http://pecl.php.net/get/ssh2


 [2010-07-14 02:30 UTC] baskaran dot b at entl dot net
I am still having following error
/usr/local/src/ssh2-0.11.0/ssh2.c:52: error: duplicate 
?static?
/usr/local/src/ssh2-0.11.0/ssh2.c: In function 
?zif_ssh2_methods_negotiated?:
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 18:01:29 2024 UTC