Install intl PHP extension OSX High Sierra

前端 未结 12 1049
予麋鹿
予麋鹿 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

    After the integration from brew/php to brew/core, the intl extension is included by the default installation. I also had the same problem the intl extension wasn't working. The problem I had was the command-line environment was not using the installed version of PHP but the default version from macOS system.

    To enable the installed version, you need to do this:

    After brew install php@7.1

    You need to link the installed PHP version by brew link php@7.1

    Then you need to OPEN A NEW TERMINAL to make it effective.
    Then double check the PHP binary path, which php

    make sure it's /usr/local/bin/php instead of /usr/bin/php

    Then check if the intl extension is enabled, php -m | grep intl

    It works for me.

提交回复
热议问题