How to solve the issue - please install the "intl" extension for full localization capabilities

How to solve the issue - please install the "intl" extension for full localization capabilities

  1. Blog
  2. 15 November 2026
  3. 3 min read

Stefan Bogdanescu

Founder & Senior Architect

How to Solve the "Install the intl Extension" Error in Symfony

When integrating currency symbols and localization data into a Symfony application, you quickly discover that the framework relies heavily on the PHP intl extension. This component provides access to CLDR (Common Locale Data Repository) data, enabling features like pluralization rules, time zone handling, and crucially, currency formatting. However, if your server returns a MethodNotImplementedException stating that Locale::setDefault() is not implemented, the issue isn't with your code logic; it is strictly an environmental configuration problem.

The error message explicitly points to the missing intl extension. In your specific case, running on Ubuntu 13.04 (Raring Ringtail), the PHP interpreter was compiled without this module or the necessary system libraries were not installed. The Intl::getCurrencyBundle() class internally calls methods within the Locale namespace that require native C functions provided by the ICU library. Without the extension, these native calls fail immediately, halting execution before any logic can run.

To resolve this on an Ubuntu-based system, you must first ensure the system package dependencies are met. The php5-intl package is often dependent on libicu-dev. Attempting to install php5-intl without the development libraries will result in a failure or a partial installation that does not link correctly with your running PHP binary.

Run the following command to install both the extension and its required dependencies:

sudo apt-get update
sudo apt-get install php5-intl libicu-dev

After installing the packages, you must restart your web server (Apache or Nginx) to load the new modules into the PHP process. Once restarted, verify that the extension is active by checking if php -i | grep intl lists a section for "intl" in the output. If the list is empty, the extension is either not installed or not loaded in your specific php.ini configuration.

If you are working with Composer or a framework like Laravel (which shares many dependencies with Symfony), you might encounter this error even after installing the system package. This happens when the compiled PHP binary used by your application differs from the system-wide PHP where you installed the extension. In such cases, simply rebooting the server is often not enough; you may need to recompile PHP or use a containerized environment like Docker where dependencies are bundled correctly.

Once the extension is loaded, your original code snippet should function as intended. The Intl::getCurrencyBundle() methods will return valid data for INR (Indian Rupee) and other currencies. However, there is a nuance to be aware of regarding currency symbols. While Intl::getCurrencyBundle()->getCurrencySymbol('INR') works perfectly for most regions, it relies on the specific locale context. The symbol for the Indian Rupee varies significantly between "₹" (used in India) and "Rs." or "INR" (often used in international contexts).

To ensure consistent display regardless of the server's default locale, always pass a specific locale code to the Intl methods rather than relying solely on Locale::setDefault('en'). For instance:

// Get symbol specifically for United States English
$symbol = \Symfony\Component\Intl\Intl::getCurrencyBundle()
    ->getCurrencySymbol('INR', 'en_US');

This approach prevents ambiguity and ensures your application renders the correct symbol based on the intended user experience. Remember that Intl is a heavy dependency due to its reliance on external ICU data files. Ensure your server has sufficient disk space for these locale data bundles, especially if you are running on a minimal VPS instance. With the extension installed and configured correctly, your currency formatting logic will be robust and ready for production.

Our network