PHP Configure Error: Please specify the install prefix of iconv with --with-iconv=<DIR>

With Homebrew:

brew install libiconv

then

./configure --with-iconv=$(brew --prefix libiconv)

brew --prefix libiconv normally evaluates to /usr/local/opt/libiconv


Do exactly as the error says in your console. It's looking for iconv but it can't find it.

./configure --with-iconv=pathToIconv

I guess we should probably check to see if iconv is installed by running "iconv --help" if it's not installed you can install it with homebrew, or you could add the existing files to your PATH variable. I am not sure how mamp works in this scenario.. PHP should use iconv if it is installed on the machine. Due to the way mamp contains itself it may be full filling this dependency in a weird way. As I understand it best practice is to have iconv built into the php installation so you should put the effort into tracking down the path.To my understanding you can install it without iconv and as long as the dependency is being fulfilled it will run as expected.

./configure --without-iconv

I had iconv installed with MacPorts so the executable was located at /opt/local/bin/iconv. Specifying ./configure --with-iconv=/opt/local did the trick.