Welcome to the most active Linux Forum on the web.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 08-29-2007, 11:14 AM   #1
Registered: Apr 2006
Distribution: ubuntu 7.04
Posts: 219

Rep: Reputation: 30
Compiling PECL ssh2 - help me debug


I'm trying to compile the ssh2 extension for PHP, but am getting an error on compiling. The relevant part of the error message is this:

/usr/local/ssh2-0.10/ssh2.c:481: error: too many arguments to function 'libssh2_session_methods'
So I opened ssh2.c and found line 481. The section is this:
(line beginning " libssh2_session_methods(session... " is line 481).

#if LIBSSH2_APINO < 200412301450
libssh2_session_methods(session, &kex, &hostkey, &crypt_cs, &crypt_sc, &mac_cs, &mac_sc, &comp_cs, &comp_sc, &lang_cs, &lang_sc);
kex = libssh2_session_methods(session, LIBSSH2_METHOD_KEX);
hostkey = libssh2_session_methods(session, LIBSSH2_METHOD_HOSTKEY);
crypt_cs = libssh2_session_methods(session, LIBSSH2_METHOD_CRYPT_CS);
crypt_sc = libssh2_session_methods(session, LIBSSH2_METHOD_CRYPT_SC);
mac_cs = libssh2_session_methods(session, LIBSSH2_METHOD_MAC_CS);
mac_sc = libssh2_session_methods(session, LIBSSH2_METHOD_MAC_SC);
comp_cs = libssh2_session_methods(session, LIBSSH2_METHOD_COMP_CS);
comp_sc = libssh2_session_methods(session, LIBSSH2_METHOD_COMP_SC);
lang_cs = libssh2_session_methods(session, LIBSSH2_METHOD_LANG_CS);
lang_sc = libssh2_session_methods(session, LIBSSH2_METHOD_LANG_SC);

I tried removing some of these "too many" arguments from the function (got rid of " &crypt_cs, &crypt_sc, &mac_cs, &mac_sc, &comp_cs, &comp_sc, &lang_cs, &lang_sc " and also the word "session", plus the corresponding lines below to make it look like this:

#if LIBSSH2_APINO < 200412301450
libssh2_session_methods(&kex, &hostkey);
kex = libssh2_session_methods(session, LIBSSH2_METHOD_KEX);
hostkey = libssh2_session_methods(session, LIBSSH2_METHOD_HOSTKEY);
Now it compiled. However, I have no programming experience, and am wary of arbitrarily modifying the code of a program when I don't know how my changes will affect how it runs, especially when the app is related to my pc's security - this being a ssh / php extension.

I have a feeling that the problem with the libssh2_session_methods function is quite simple, but as I can't program, I don't know how the function should be modified. Can anyone help me clean up the code for the program and fix this bug? (I'd ask the developer, but I don't think it's maintained).

I'm using Ubuntu 7.04 amd64, by the way.


Last edited by 144419855310001; 08-29-2007 at 12:23 PM.


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
Gentoo not installing pecl-pdo 70mas Linux - Server 1 08-05-2007 11:20 PM
Compiling With Debug Info Does Not Work? spotmax777 Linux - General 0 07-18-2007 02:30 PM
php pear/pecl zip extension slackamp Slackware 1 06-11-2007 09:55 PM
How to debug without having debug section in an executable ? unclesam Linux - Newbie 0 02-02-2006 07:23 AM
PHP and PECL ID3 Ed_Bastard Linux - Software 0 10-26-2005 05:01 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:15 AM.

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