Install SSH2 with MAMP Pro 5.5.10+

MAMP PRONew CategoryPECLPHPssh2

I ran into the issue with php.h missing.

 

The path for this system is set with

 

export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin:

export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad

export MAMP_PHP=/Applications/MAMP/bin/php/php5.5.10/bin
export PATH=”$MAMP_PHP:$PATH”

 

This ensures PHP from MAMP Pro is being used not the OSX version. 

 When trying to compile SSH2 php.h is missing which causes fatal error…. 

 Follow these steps, and retry SSH2 compilation as per these steps.

  

Here’s how I fixed it:

  1. MAMP doesn’t provide the source code archive for PHP 5.4.10 so download it from php.net
  2. Extract the source code archive to /Applications/MAMP/bin/php/php5.4.10/include/php
  3. Run ./configure to configure the source code for your platform (without this step the pecl install will fail looking for a bunch of header files)
  4. Retry compilation for ssh2

 

If you run phpinfo() you should now get an entry for ssh2 as follows:

ssh2

SSH2 support enabled
extension version 0.12
libssh2 version 1.4.3
banner SSH-2.0-libssh2_1.4.3 

 

Additional reading:

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

Leave a Reply