Howto - php libssh2 patch

Bill Pitz

Managed IT and Network Engineering: North Bay Logistics, LLC



If you are receiving the following compile error trying to install the libssh2 PECL module (ssh2-0.10):

/usr/src/php-5.2.4/ssh2-0.10/ssh2.c: In function 'zif_ssh2_methods_negotiated':
/usr/src/php-5.2.4/ssh2-0.10/ssh2.c:481: warning: passing argument 2 of
    'libssh2_session_methods' makes integer from pointer without a cast
/usr/src/php-5.2.4/ssh2-0.10/ssh2.c:481: error: too many arguments to
    function 'libssh2_session_methods'
/usr/src/php-5.2.4/ssh2-0.10/ssh2.c: In function 'zif_ssh2_fingerprint':
/usr/src/php-5.2.4/ssh2-0.10/ssh2.c:536: warning: assignment discards qualifiers
    from pointer target type
/usr/src/php-5.2.4/ssh2-0.10/ssh2.c: In function 'zif_ssh2_publickey_add':
/usr/src/php-5.2.4/ssh2-0.10/ssh2.c:1038: warning: passing argument 1 of '_efree'
    discards qualifiers from pointer target type
/usr/src/php-5.2.4/ssh2-0.10/ssh2.c: In function 'zif_ssh2_publickey_list':
/usr/src/php-5.2.4/ssh2-0.10/ssh2.c:1097: warning: passing argument 4 of
    'add_assoc_stringl_ex' discards qualifiers from pointer target type
/usr/src/php-5.2.4/ssh2-0.10/ssh2.c:1098: warning: passing argument 4 of
    'add_assoc_stringl_ex' discards qualifiers from pointer target type
/usr/src/php-5.2.4/ssh2-0.10/ssh2.c:1106: warning: initialization discards
    qualifiers from pointer target type
/usr/src/php-5.2.4/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

Here's a patch against the ssh2-0.10 source. Put the patch in the ssh2-0.10 directory.
Run patch < php-libssh2.diff and compile as usual.