Install intl PHP extension OSX High Sierra

前端 未结 12 999
予麋鹿
予麋鹿 2020-12-01 04:39

How can I install intl PHP extension in PHP 7.1.7, which is delivered with osx high sierra?

相关标签:
12条回答
  • 2020-12-01 05:08

    Remove the following file with

    rm /usr/local/etc/php/7.1/conf.d/ext-intl.ini
    

    Worked for me, thanks to homebrew-core Issue

    0 讨论(0)
  • 2020-12-01 05:11

    I have managed to work this out.

    First uninstall any php packages you have completely with brew, then run the brew update and brew doctor commands.

    Now install with brew install php@7.1 (changed the version as needed) intl is included in the build for all php-formulae.

    To confirm it is working run php -m | grep intl. You will see the intl extension is included. If not check the php.ini file and make sure the extension is being loaded.

    0 讨论(0)
  • 2020-12-01 05:12

    I'm running the brew 1.6.2, on OS High Sierra. The intl extension is not available in brew packages so far.

    The @Mondy solution worked fine for me. After run the

    curl -s http://php-osx.liip.ch/install.sh | bash -s 7.1
    

    The packages will be available in /usr/local/php5 or /usr/local/php5-7.0.27-20180201-135220.

    So in your /usr/local/etc/php/7.0/php.ini you can place the following lines to enable the intl extension:

    [intl]
    extension="/usr/local/php5/lib/php/extensions/no-debug-non-zts-20151012/intl.so"
    

    In my case I prefered to create a file 'ext-intl.ini' in /usr/local/etc/php/7.0/conf.d/, just for a better organization.

    0 讨论(0)
  • 2020-12-01 05:15

    I installed php7.2 with brew and linked with that version on Mac, but cannot see even the version number 7.2 in phpinfo(). It always showed the last version(7.1) even though uninstall with brew, so the intl extension. I found we have to modify httpd.conf file(in my case in /etc/apache2/httpd.conf), in that file you can find the

    LoadModule php7_module libexec/apache2/libphp7.so
    

    in that line you have to override with your new php72 path: in my case it was

     LoadModule php7_module /usr/local/Cellar/php@7.2/7.2.31_1/lib/httpd/modules/libphp7.so
    

    And restart apache, it works fine.

    0 讨论(0)
  • 2020-12-01 05:18

    open a terminal then type:

    brew search intl
    

    you should be able to see php71-intl, then run

    brew install homebrew/php/php71-intl
    

    then restart apache

    sudo apachectl restart
    

    then type:

    php -i | grep intl
    

    you should be able to see something like this:

    Additional .ini files parsed => /usr/local/etc/php/7.1/conf.d/ext-intl.ini
    intl
    intl.default_locale => no value => no value
    intl.error_level => 0 => 0
    intl.use_exceptions => 0 => 0
    

    Enjoy!

    0 讨论(0)
  • 2020-12-01 05:18

    Try this :

    brew install php71-intl
    
    0 讨论(0)
提交回复
热议问题