LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices

Reply
 
Search this Thread
Old 12-28-2007, 06:21 AM   #1
jacorall
LQ Newbie
 
Registered: May 2006
Distribution: Ubuntu
Posts: 2

Rep: Reputation: 0
libssh2 not linking to PHP on Ubuntu 7.10 (Gutsy)


I am trying to get libssh2 to work with PHP on Ubuntu 7.10 (Gutsy). The aim is to use SSH2 via PHP.

I've downloaded the source of libssh2, compiled it and installed it using:
Quote:
./configure
make all install

pecl install -f ssh2
I then get the following output stating that make failed:
Quote:
WARNING: failed to download pecl.php.net/ssh2 within preferred state "stable", will instead download version 0.10, stability "beta"
downloading ssh2-0.10.tgz ...
Starting to download ssh2-0.10.tgz (22,187 bytes)
....done: 22,187 bytes
5 source files, building
running: phpize
Configuring for:
PHP Api Version: 20041225
Zend Module Api No: 20060613
Zend Extension Api No: 220060519
building in /var/tmp/pear-build-root/ssh2-0.10
running: /tmp/pear/cache/ssh2-0.10/configure
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 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.9.11 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... 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/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 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++... no
checking for c++... no
checking for gpp... no
checking for aCC... no
checking for CC... no
checking for cxx... no
checking for cc++... no
checking for cl.exe... no
checking for FCC... no
checking for KCC... no
checking for RCC... no
checking for xlC_r... no
checking for xlC... no
checking whether we are using the GNU C++ compiler... no
checking whether g++ accepts -g... no
checking for g77... no
checking for xlf... no
checking for f77... no
checking for frt... no
checking for pgf77... no
checking for cf77... no
checking for fort77... no
checking for fl32... no
checking for af77... no
checking for xlf90... no
checking for f90... no
checking for pgf90... no
checking for pghpf... no
checking for epcf90... no
checking for gfortran... no
checking for g95... no
checking for xlf95... no
checking for f95... no
checking for fort... no
checking for ifort... no
checking for ifc... no
checking for efc... no
checking for pgf95... no
checking for lf95... no
checking for ftn... no
checking whether we are using the GNU Fortran 77 compiler... no
checking whether accepts -g... no
checking the maximum length of command line arguments... 98304
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 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 static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking whether the gcc 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 libtool
appending configuration tag "CXX" to libtool
appending configuration tag "F77" to libtool
configure: creating ./config.status
config.status: creating config.h
running: make
/bin/bash /var/tmp/pear-build-root/ssh2-0.10/libtool --mode=compile gcc -I. -I/tmp/pear/cache/ssh2-0.10 -DPHP_ATOM_INC -I/var/tmp/pear-build-root/ssh2-0.10/include -I/var/tmp/pear-build-root/ssh2-0.10/main -I/tmp/pear/cache/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/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/local/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/var/tmp/pear-build-root/ssh2-0.10/include -I/var/tmp/pear-build-root/ssh2-0.10/main -I/tmp/pear/cache/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/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/local/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:481: warning: passing argument 2 of 'libssh2_session_methods' makes integer from pointer without a cast
/tmp/pear/cache/ssh2-0.10/ssh2.c:481: 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:536: 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:1038: 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:1097: warning: passing argument 4 of 'add_assoc_stringl_ex' discards qualifiers from pointer target type
/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:1106: warning: initialization discards qualifiers from pointer target type
/tmp/pear/cache/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

Does anyone know how I can correct this or have an easier method of getting libssh2 to work with PHP. on Ubuntu?
 
Old 12-30-2007, 10:06 AM   #2
rh-penguin
Member
 
Registered: Sep 2006
Location: England, London
Distribution: Debian, BT2
Posts: 57

Rep: Reputation: 15
i've got the same problem aswell using debian etch.
Anyone?
 
Old 12-30-2007, 10:32 AM   #3
rh-penguin
Member
 
Registered: Sep 2006
Location: England, London
Distribution: Debian, BT2
Posts: 57

Rep: Reputation: 15
ok i found a fix.
1. Download this patch: http://www.billpitz.com/howto/php-libssh2.diff and place it in the ssh2-0.10 dir.
2. Type: patch < php-libssh2.diff to apply the patch.
3. Then carry on installing as you wish.
 
  


Reply

Tags
php, ubuntu


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Upgrade Ubuntu 7.04 (Feisty Fawn) to Ubuntu 7.10 (Gutsy Gibbon) LXer Syndicated Linux News 1 03-28-2009 01:17 PM
IBM T43p and Ubuntu Gutsy numbers1thru9 Linux - Laptop and Netbook 2 11-07-2007 10:49 PM
LXer: Installing Xen On An Ubuntu 7.10 (Gutsy Gibbon) Server From The Ubuntu Reposito LXer Syndicated Linux News 0 11-06-2007 08:50 PM
LXer: The Perfect Server - Ubuntu Gutsy Gibbon (Ubuntu 7.10) LXer Syndicated Linux News 0 10-21-2007 11:20 AM
LXer: Ubuntu 7.10 (Gutsy Gibbon) Release Dates and Mark Shuttleworth About Gutsy LXer Syndicated Linux News 0 04-12-2007 04:31 PM


All times are GMT -5. The time now is 11:29 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration