Skip to content
Start » PHP » Laravel PHP – Class 'NumberFormatter' Not Found

Laravel PHP – Class 'NumberFormatter' Not Found

When installing an application on a Windows server (project need, adaptation to the client's infrastructure), I came across the error “NumberFormatter Not Found”.

The first reaction was to check if I had forgotten any commits from my PHP development environment Laravel local to the Github repository, which had a namespace bug fix, was not the case.

Second option to find the cause: Google it.

I promptly received the expected return, the extension php intl is responsible for NumberFormatter and was not installed or enabled on the IIS Windows server.

To do so, just edit the file php.ini and uncomment the following line:

extension=ext/php_intl.dll

On Windows installation it worked normally, just save the file php.ini and call the application again - it was running a command php artisan by the terminal.

However, if you were on a server Linux, compatible with Debian, such as Ubuntu or Mint (versions I usually use), it would be necessary to install the php intl extension on the server.

To do this, just run the following command line in the terminal:

sudo apt-get install php7.4-intl

Heads up the PHP version. In this example I suggest version 7.4, if you are using PHP 8 or higher, adjust the command line accordingly.

Now just run the application and see it working without errors – at least not for this extension.

Leave a Reply

Your email address will not be published.

en_USEnglish
%d bloggers like this: