noa-dev
noa-dev

Reputation: 3641

macOS Sierra installing PHP Extension intl

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 enter image description here 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

Upvotes: 4

Views: 5578

Answers (1)

user7445127
user7445127

Reputation:

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.

Upvotes: 2

Related Questions