You will require 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.
Adding SSH2 extension to your MAMP the sure way
- Download libssh2 from source forge, direct link here
- 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:
- Download SSH2 PECL source code, get the latest stable version.
- 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.
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.
- Look in
ssh2-0.12.0/modules/ to find ssh2.so
Copy this file to your MAMP location.
- Chmod 755 the location of your ssh2.so file.
- Edit templates in MAMP Pro, File->Edit Template->PHP-> Choose the PHP version you have compiled with.
- Add the line , in the [extensions] section
- Save changes
- Restart MAMP Pro
- Check phpinfo()
- Try it out
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.