Introduction
When you first install CakePHP3, I guess “enable the intl extension” is the first hurdle.
It’s been a while since I first dealt with this problem, but I remember it was complicated a little.
Today, I’m going to introduce some solutions worked for me.
The Terminal command might intimidate you, but don’t worry!
I’m going to share every step I took.
Environment
macOS High Sierra
XAMPP 7.0.26
CakePHP3
Let’s get started!
Step1: Open Terminal and Check if Homebrew is installed
If it returns:
/usr/local/bin/brew → Step3
not found → Step2
Step2: Install Homebrew
Access to https://brew.sh/, then copy and Paste a install command.
Step3: Check PHP path
If it returns:
/usr/bin/php → Step4
/Applications/XAMPP/xamppfiles/bin/php → Step5
Step4: Change Path
Step5: Install icu4c
Step6: Install intl
Users-MacBook:~ user$ sudo pecl install intl
If you get “Cannot find autoconf” message:
Succeed → Step7
Failed → Skip Step7
Step7: Activate intl & Restart XAMPP
Open /Applications/XAMPP/xamppfiles/etc/php.ini , and find extension=intl.so
↓
extension=intl.so // Remove semicolon
Then, restart XAMPP.
Another way to install Intl
The above steps may not work for you. In this step, I’ll introduce you a different way.
1. Open a new window in Terminal.
2. Search available intl version.
You’ll get the result like this:
homebrew/php/php54-intl homebrew/php/php56-intl homebrew/php/php71-intl
If you can’t find any intl, try “php@7.1”
>> Users-MacBook:~ user$ brew install php@7.1
3. Install Intl according to your PHP version.
4. Activate intl & Restart XAMPP
Open /Applications/XAMPP/xamppfiles/etc/php.ini , and find extension=intl.so
extension=”/usr/local/Cellar/php70-intl/7.0.27_24/intl.so” ← Add (change the path according to your version.)
Then, restart XAMPP.
References
https://stackoverflow.com/questions/27886117/php-intl-installation-on-xampp
https://stackoverflow.com/questions/36408338/compiling-php-intl-extension-on-mac-book-pro-el-capitan-10-11-4