Question

I have began installing pecl on MAMP. I have added the correct php version to the path and when which php it says /Applications/MAMP/... which is correct.

I have downloaded the Server Components and libraries moved them to a new folder in my php and run the ./configure everything seems to run ok and looked through all the checks being performed while installing and unpacking.

It gets to the last line and says;

configure: error: Please specify the install prefix of iconv with --with-iconv=<DIR>

Where should I set the <DIR> for the iconv?

Just make another folder and point it at that?

I am only trying to get the mongo pecl installed.

The information I have followed is here http://www.lullabot.com/blog/article/installing-php-pear-and-pecl-extensions-mamp-mac-os-x-107-lion

Was it helpful?

Solution 2

Working on this right now and found a workaround to just disable iconv with ./configure --without-iconv which not the best solution of course, but works for me.

Edit: Downloaded libiconv-1.14 package, and after running ./configure , make, make install, PHP configure runs fine.

OTHER TIPS

Wait wait wait wait. Why are you rebuilding your PHP installation to install the MongoDB driver?

You don't have to do that.

Just run e.g.:

/Applications/MAMP/bin/php/php7.1.1/bin/pecl install mongo

Assuming thats the full path to the pecl command part of your MAMP installation.
You might need to replace /php7.1.1/ with your current and active MAMP php version.

This did it for me:

$ ./configure --with-iconv=/usr/lib/

First needed to install libxml2 and libxslt via homebrew though:

$ brew install libxml2
$ brew install libxslt
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top