Installing the PHP intl extension on OS X EI Capitan

Sometimes one needs to use internationalization features in PHP. It might be that a library that you are using depends upon the PHP intl extension. Please note that there are incredibly many ways to accomplish this, so this is merely my way of doing it. Please also note that this article is intended for OS X EI Capitan. I hope this post is useful for you.

We can install PHP intl extension in three simple step:

Install Homebrew

Macbook comes with ruby pre-installed. So, we can install homebrew just by entering the following command from terminal. For more information on installation, consider reading Homebrew,

$ ruby -e “$(curl -fsSL <a href="https://raw.github.com/Homebrew/homebrew/go/install" 
rel="nofollow" data-mce-href="https://raw.github.com/Homebrew/homebrew/go/install">
https://raw.github.com/Homebrew/homebrew/go/install</a>)”

Update Homebrew 

Once you have that next step is to keep your dependencies updated. Please note that, this step might be optional in case your all dependent repo are update. Its good practice to keep your repositories updated.


$ brew doctor

Better to update the extensions shown by brew doctor.

Install Extension

The next step is easy and short. You can install intl extension depending upon your requirement. Here, I assume to install PHP70-intall. You have option to choose which one you want to install.

$ brew install php70-intl

OR

$ brew install php56-intl

OR

$ brew install php55-intl

OR

$ brew install php54-intl

I hope this short post is useful to someone in a way or another. If this does not help you might consider reading how to install intl extension on Mavericks

About the Author

dr.code.skm

I am backend developer with passion in Web Application development using latest technologies like Laravel, PHP7, React, ECMAScript 6 and WordPress. I prefer spending time analyzing big data with Apache Spark. Apart from that, I do photography.