Issue with installing Intl on OSX

Hey, so I’ve been having an issue with installing Intl. I’m on OSX high sierra with brew installed, using php 71

I tried this but as you can see it fails any ideas as to what it is moaning about ~ thanks in advance:

sudo pecl install intl
downloading intl-3.0.0.tgz ...
Starting to download intl-3.0.0.tgz (248,200 bytes)
....................................................done: 248,200 bytes
150 source files, building
running: phpize
Configuring for:
PHP Api Version:         20160303
Zend Module Api No:      20160303
Zend Extension Api No:   320160303
Specify where ICU libraries and headers can be found [DEFAULT] :
building in /private/tmp/pear/install/pear-build-rootRPmjaU/intl-3.0.0
running: /private/tmp/pear/install/intl/configure --with-php-config=/usr/bin/php-config --with-icu-dir=DEFAULT
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-apple-darwin17.4.0
checking host system type... x86_64-apple-darwin17.4.0
checking target system type... x86_64-apple-darwin17.4.0
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib
checking for PHP extension directory... /usr/lib/php/extensions/no-debug-non-zts-20160303
checking for PHP installed headers prefix... /usr/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... no
checking for nawk... no
checking for awk... awk
checking if awk is broken... no
checking whether to enable internationalization support... yes, shared
checking for icu-config... no
checking for location of ICU headers and libraries... not found
configure: error: Unable to detect ICU prefix or no failed. Please verify ICU install prefix and make sure icu-config works.
ERROR: `/private/tmp/pear/install/intl/configure --with-php-config=/usr/bin/php-config --with-icu-dir=DEFAULT' failed

This seems like a environment issue - a quick Google suggests that you need additional packages (see here for an example) to fix that problem.

I have managed to work this out. I’m leaving the instructions for anyone else that may come across this issue.

First uninstall php completely with brew, then run the brew update and brew doctor commands.

now install with brew php71 (changed the version as needed) intl is included in the build so you away.

to confirm it is working run php -m you will see the intl extension there. If not check the php.ini file and make sure the extension is being loaded.

Yeah so my windows and linux environments are okay, it’s specific to OSX, lots of Googling before coming here. Seems like the Brew packages are in a mess and some have been removed, so I’m trying to see if anyone has additional advice.