Install intl PHP extension OSX High Sierra

匿名 (未验证) 提交于 2019-12-03 07:36:14

问题:

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

回答1:

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!



回答2:

In addition to what L. Grolleau says (run brew install php71-intl), paste the int.so path to the /php.ini at the end of the file:

extension=/usr/local/Cellar/php71-intl/7.1.11_20/intl.so 


回答3:

I find a solution.

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

Then I copied intl.so from the installation to my extension directory, which is defined into my php.ini.



回答4:

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.



回答5:

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.



回答6:

try this

brew install homebrew/php/php71-intl 


回答7:

Try this :

brew install php71-intl 


标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!