Install PHP Internationalization extension (Intl) on XAMPP on Mac

前端 未结 3 1693
太阳男子
太阳男子 2020-12-09 11:50

How can I install Intl on my XAMPP server on OS X?

I tried modifying my XAMPP>etc>php.ini and uncommenting the line:

;extension=php_         


        
3条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-09 12:20

    I failed on my XAMPP on Mac with:

    $ brew install icu4c
    

    , after which I've got message:

    intl ICU version installed on your system is outdated (4.8.1.1) and does not match the ICU data bundled with Symfony (57.1)

    I solved my problem by running command to download, unpack, compile and install ICU of required version (you can choose another version here http://site.icu-project.org/download if needed, file should ends with ...src.tgz):

    $ curl -sS -o /tmp/icu.tar.gz -L http://download.icu-project.org/files/icu4c/57.1/icu4c-57_1-src.tgz && tar -zxf /tmp/icu.tar.gz -C /tmp && cd /tmp/icu/source && ./configure --prefix=/usr/local && make && sudo make install
    

    than run:

    $ sudo pecl install intl
    

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

    /usr/local
    

    then edited 'php.ini' with extension=intl.so and reboot apache.

    Checked result with:

    \n";
        echo "ICU: " . INTL_ICU_VERSION . "
    \n"; } else { die('OOPS! The intl extension is not enabled!'); }

提交回复
热议问题