LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

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

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


Hi

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:

Quote:
/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).


Quote:
#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);
#else
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);
#endif

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:

Quote:
#if LIBSSH2_APINO < 200412301450
libssh2_session_methods(&kex, &hostkey);
#else
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.

Thanks

Last edited by 144419855310001; 08-29-2007 at 11:23 AM.
 
  


Reply


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


All times are GMT -5. The time now is 11:37 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