Installing libssh2 (2.0.18) on FreeBSD 5.4

This article describes, on FreeBSD 5.4, how to get libssh2 (2.0.18) support in PHP (4.4.2), and how to install autoconf 2.62 in the process. (This may or may not work with similar versions of said software. The patch used here is claimed to work with FreeBSD "5.x".)

# 0. Obtain root privileges
# 1. Install libssh

cd /usr/ports/security/libssh2
make
make install

# 2. Patch autoconf-2.62, source is here:
#    http://www.mavetju.org/mail/view_message.php?list=freebsd-ports-bugs&id=2749049

cd /usr/ports
patch -p0 < $PATCH

# 3. Modify PATH and PHP_AUTOCONF, PHP_AUTOHEADER,
#     see /usr/local/bin/phpize if you want an explanation...

setenv PATH ${PATH}:/usr/local/bin
setenv PHP_AUTOCONF autoconf-2.62
setenv PHP_AUTOHEADER autoheader-2.62

# 4. Install SSH extension for PHP
#    Note that /usr/local/etc/php/extensions.ini will be updated automatically,
#    and ssh2.so copied to the right place
#
#    Possible additional reference:
#    http://se.php.net/manual/en/ssh2.installation.php

cd /usr/ports/security/pecl-ssh2
make
make install

# 5. Reload / restart Apache.
#    If installation was successful, there should be an "ssh2" section of phpinfo
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License