How to enable the intl extension to use CakePHP or Magento on mac

Home > Blog > Learning > How to enable the intl extension to use CakePHP or Magento on mac

Introduction

When you first install CakePHP3 or Magento, 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 that worked for me.The Terminal command might intimidate you, but don’t worry! I’m going to share every step I took.

Environment

macOS Catalina MAMP 5.7 CakePHP3 / Magento

Let’s get started!

Step1: Open Terminal and Check if Homebrew is installed

Users-MacBook:~ user$ which brewIf it returns: /usr/local/bin/brew → Step3 not found → Step2

Step2: Install Homebrew

Access to https://brew.sh/, then copy and Paste an install command.Users-MacBook:~ user$ Copy & Paste Here

Step3: Check PHP path

Users-MacBook:~ user$ which phpIf it returns: /usr/bin/php → Step4 /Applications/MAMP/bin/php/php7.2.7/bin → Step5

Step4: Change Path

Users-MacBook:~ user$ PATH=”/Applications/MAMP/bin/php/php7.2.7/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 intlIf you get “Cannot find autoconf” message:Users-MacBook:~ user$ brew install autoconfSucceed → Step7 Failed → Skip Step7

Step7: Activate intl & Restart XAMPP

Open /Applications/MAMP/bin/php/php7.2.7/conf/php.ini , and find extension=intl.so;extension=intl.so ↓ extension=intl.so   // Remove semicolonThen, restart MAPP.

STEP8: Check the installation

There are two ways to check if our intl installation is success. First is using the following command
$ php -m | grep intl

References

https://stackoverflow.com/questions/27886117/php-intl-installation-on-xampphttps://medium.com/better-programming/how-to-install-a-php-7-2-on-macos-10-15-catalina-using-homebrew-and-pecl-ad5b6c9ffb17https://stackoverflow.com/questions/36408338/compiling-php-intl-extension-on-mac-book-pro-el-capitan-10-11-4http://budiirawan.com/install-php-intl-extension-os-x/https://stackoverflow.com/questions/27886117/php-intl-installation-on-xampp

Leave a Reply

Your email address will not be published. Required fields are marked *