Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing PECL on MAMP

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

like image 731
StudentRik Avatar asked Oct 23 '13 22:10

StudentRik


People also ask

How do I know if PECL is installed?

PECL modules are C extensions (programs) that can be compiled into PHP. To determine if a particular PECL module is installed and enabled, you will want to create a phpinfo page and check for the specific PECL module you are looking to use in your PHP code.

What is pear and PECL?

pear is a php classes written in php Whereas pecl is extensions which not written in php and need compiling .


3 Answers

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.

like image 133
bjori Avatar answered Oct 03 '22 12:10

bjori


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.

like image 38
Harutyun Drnoyan Avatar answered Oct 03 '22 12:10

Harutyun Drnoyan


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
like image 28
Bramus Avatar answered Oct 03 '22 13:10

Bramus