FATAL ERROR: YOU MUST ENABLE THE INTL EXTENSION TO USE CAKEPHP
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.
Bạn đang xem: Fatal error: you must enable the intl extension to use cakephp
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: xuất hiện Terminal and kiểm tra if Homebrew is installed
Users-MacBook:~ user$ which brew
If it returns: /usr/local/bin/brew → Step3 not found → Step2
Step2: Install Homebrew
Access lớn https://brew.sh/, then copy & Paste a install command.
Users-MacBook:~ user$ Copy & Paste Here
Step3: kiểm tra PHP path
Users-MacBook:~ user$ which php
If it returns: /usr/bin/php → Step4 /Applications/XAMPP/xamppfiles/bin/php → Step5
Step4: Change Path
Users-MacBook:~ user$ PATH=”/Applications/XAMPP/xamppfiles/bin:$PATH”
Step5: Install icu4c
Users-MacBook:~ user$ brew install icu4c
Step6: Install intl
Users-MacBook:~ user$ sudo pecl update-channels Users-MacBook:~ user$ sudo pecl install intl
If you get “Cannot find autoconf” message:
Users-MacBook:~ user$ brew install autoconf
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 ↓ extension=intl.so // Remove semicolon
Then, restart XAMPP.
Xem thêm: Tự Học Thiết Kế Giao Diện Web Bằng Dreamweaver Cs6, Cực Đơn Giản, Dễ Thực Hiện
Another way to lớn install Intl
The above steps may not work for you. In this step, I’ll introduce you a different way.
1. Xuất hiện a new window in Terminal.
2. Search available intl version.
Users-MacBook:~ user$ brew tìm kiếm intl
You’ll get the result lượt thích this:
homebrew/php/php53-intl homebrew/php/php55-intl homebrew/php/php70-intl homebrew/php/php54-intl homebrew/php/php56-intl homebrew/php/php71-intl
Note
If you can’t find any intl, try “php
7.1” >> Users-MacBook:~ user$ brew install php
7.1
3. Install Intl according to lớn your PHP version.
Xem thêm: 【How To】 Check Data Balance I Have A Data, Viettel Simcard, Saigon Forum
Users-MacBook:~ user$ brew install homebrew/php/php70-intl
4. Activate intl & Restart XAMPP
Open /Applications/XAMPP/xamppfiles/etc/php.ini , và find extension=intl.so
;extension=intl.so extension=”/usr/local/Cellar/php70-intl/7.0.27_24/intl.so” ← showroom (change the path according khổng lồ 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
ABOUT ME
Sara
Working as a freelance programmer in Japan.I try to make coding as simple as possible.Hope you enjoy coding