PHP Configure Error: Specify the iconv installation prefix with --with-iconv = <DIR>

I am trying to configure PHP 5.5 to MAMP, after this post:

Having trouble trying to install OAUTH with PECL in MAMP on Mac OS lion .

After moving the downloaded PHP folders to MAMP/bin/php (I also tried to create the /php5.5.14/include/php directory as described in the post above) and ran ./configure .

There was an error:

 checking for iconv support... yes checking for iconv... no checking for libiconv... no configure: error: Please specify the install prefix of iconv with --with-iconv=< DIR > 

Where can I specify the "installation prefix" or how to solve this problem?

Thanks!!

+6
source share
3 answers

Do the same as the error on your console. He is looking for an icon, but he cannot find it.

 ./configure --with-iconv=pathToIconv 

I think we should probably check if iconv is installed when "iconv --help" is started, if it is not installed, you can install it using homebrew or add existing files to your PATH variable. I'm not sure how mom works in this scenario. PHP should use iconv if it is installed on the machine. Due to the way Mom maintains herself, he can fill this addiction in a weird way. As far as I understand, the best practice is to include iconv in your php installation, so you should make an effort to track the path. To my understanding, you can install it without iconv, and while the dependency is running, it will work as expected.

 ./configure --without-iconv 
+5
source

With Homebrew :

 brew install homebrew/dupes/libiconv 

then

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

brew --prefix libiconv usually rated as /usr/local/opt/libiconv

+7
source

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

+5
source

Source: https://habr.com/ru/post/972933/


All Articles