Ruby on Rails, programming, and SEO
Check out my articles about Ruby on Rails, programming, and SEO. Weekly updates? Subscribe to my feed.

Installing SSH2 for PHP on Mac OS X

How to install SSH2 for PHP on a Mac running OS X.

Install libssh2 using MacPorts:

$ sudo port install libssh2

Install ssh2 to PHP:

$ sudo pecl install channel://pecl.php.net/ssh2-0.11.2

When asked for libssh2 prefix, enter /opt/local and press Enter.
Pecl will now install ssh2.

Add the following line to /etc/php.ini:

extension=ssh2.so

Restart Apache:

$ sudo apachectl restart

And you’re done! PHP can now use SSH2.

Follow me on Twitter

Related posts

Tags: , ,

3 comments

  1. bob says:

    Office:~ blowupp$ sudo port install libssh2
    sudo: port: command not found

  2. lassebunk says:

    First install MacPorts from http://www.macports.org/
    /Lasse

  3. Thank you very much, I’ve been unsuccessful in trying to find the correct prefix!

Leave a comment

 
Fork me on GitHub