Search code examples
phpterminalmacos-high-sierraintl

Can't install php Intl extension on MacosX


I'm following this link to install this PHP extension but I'm stuck in the middle.
When I try to run this command pecl install intl I get this message:

Specify where ICU libraries and headers can be found [DEFAULT] :

And I don't know where the ICU libraries are located.
If I press Enter I get this error:

configure: error: Unable to detect ICU prefix or no failed. Please verify ICU install prefix and make sure icu-config works.
ERROR: `/private/tmp/pear/install/intl/configure --with-php-config=/usr/bin/php-config --with-icu-dir=DEFAULT' failed

How can I locate the correct path of ICU libraries ? I'm using High Sierra and MAMP with PHP version 7.1


Solution

  • ICU stands for ICU - International Components for Unicode

    Install it with brew

    brew update
    brew search icu # returns 'icu4c'
    brew install icu4c
    

    OR

    Install it with pecl

    sudo pecl update-channels
    sudo pecl install intl
    

    installing intl package on osx