Adding SSH2 to MAMP and MAMP PRO on Yosemite the easy way

MAMP PROPHPssh2ssh2_connectYosemite

 

You will require autoconf.

http://mac-dev-env.patrickbougie.com/autoconf/

Install via the above instructions will work. Also, using Homebrew will work.

Cannot find autoconf. Please check your autoconf installation and the

$PHP_AUTOCONF environment variable. Then, rerun this script.

Download the php version that matches the one you will be using with MAMP Pro.

Copy the extracted files to MAMP php folder in /Applications/MAMP/bin/php/php5.5.18/include/php

Do not copy the subfolder created by the extraction, only copy the contents of that folder. You may have to create the ‘include/php/‘ folders as they might not already exist.

Also, do change the PHP version number to match the one you’re using.

./configure --without-iconv

Adding SSH2 extension to your MAMP the sure way

  1. Download libssh2 from source forge, direct link here
  2. Then extract the package, configure, compile and install it.
    user:compile$ tar -xf libssh2-1.2.1.tar
    user:compile$ cd libssh2-1.2.1
    user:libssh2-1.2.1$ ./configure
    user:libssh2-1.2.1$ make
    user:libssh2-1.2.1$ sudo make install
    Password:
    
  3. Download SSH2 PECL source code, get the latest stable version.
  4. Then untar and compile it.
    user:compile$ tar -xf ssh2-0.12.0.tar
    user:compile$ cd ssh2-0.12.0
    user:ssh2-0.12.0$ phpize
    If you don’t have have autoconf installed this is where you will get an error. Cannot find autoconf. Otherwise, proceed.
    user:ssh2-0.11.0$ ./configure
     
    If you get this error

    /Applications/MAMP/bin/php/php5.5.18/include/php/Zend/zend.h:51:11: fatal error: ‘zend_config.h’

          file not found


     
    This is probably because you did not compile the PHP you downloaded.
     
    user:ssh2-0.11.0$ make
    
     
  5. Look in
    ssh2-0.12.0/modules/ to find ssh2.so
    Copy this file to your MAMP location.
  6. Chmod 755 the location of your ssh2.so file.
  7. Edit templates in MAMP Pro, File->Edit Template->PHP-> Choose the PHP version you have compiled with.
  8. Add the line , in the [extensions] section
    1. extension=ssh2.so
  9. Save changes
  10. Restart MAMP Pro
  11. Check phpinfo()
  12. Try it out

2015 03 01 11 47 08 PM 

If you are using Linux, such as Debian, Ubuntu you can install XAMPP for Linux. Compile ssh2 using the same instructions, update the php.ini file the same way. 

 

 

Creds: http://stackoverflow.com/questions/10717752/having-problems-while-try-to-install-oauth-with-pecl-in-mamp-on-mac-os-lion

http://stackoverflow.com/questions/24987305/php-configure-error-please-specify-the-install-prefix-of-iconv-with-with-icon

Leave a Reply