For a recent project I needed to use the ssh2 extension with PHP. I had tried to use phpseclib, but found that it doesn’t support for DSA keys (a requirement for my project). Using the instructions below, you can easily install ssh2 support for PHP using homebrew. Using homebrew to install libssh2: brew install libssh2 I was working with a fresh OSX Lion install, so I needed to install pear. Lucki