macOS Sierra installing PHP Extension intl

纵饮孤独 提交于 2019-12-23 13:05:16

问题


I am trying to get magento 2.x to run on my machine. I am using xampp 5.6 with the same php version and running a virtual apache server.

As seen in this screenshot The PHP Extension intl. is missing.

I was researching on how it can be added / activated.

I tried uncommenting the extension in the php.ini of xampp but it still appears as missing.

I tried to follow this guide, but when I try to install intl with

sudo pecl install intl

it fails with

2 warnings and 1 error generated.
make: *** [php_intl.lo] Error 1
ERROR: `make' failed

回答1:


You have to provide the intl.so file which doesn't come with XAMPP.

To fix this you just have to follow the steps below.

  1. Get the intl.so file (explained below)
  2. Copy the intl.so file to /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-[some date]/
  3. Add a new line extension=intl.so to the end of your php.ini which is usually located at /Applications/XAMPP/xamppfiles/etc/php.ini
  4. Restart Apache Server

Only the first step is different for different users.

You have to get the correct intl.so file.

if you have php 7.0 run brew install php70-intl other versions must be php71-intl or php56-intl.

Your intl.so can be found in /usr/local/Cellar/php70-intl/[version]/intl.so

It should be similar for different php versions.

To copy it : open your terminal

cd /usr/local/Cellar/php70-intl/[version]/
cp intl.so /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-[some date]/

Now add your entry to the php ini file and restart Apache.



来源:https://stackoverflow.com/questions/43014111/macos-sierra-installing-php-extension-intl

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