If you have ever come across “NumberFormatter Class Not Found” error when installing a PHP Laravel application on a Windows or Linux server, this article will help you resolve this issue.

Let’s explore in this article the cause for the error class "numberformatter" not found in PHP Laravel, and how to resolve it on both operating systems: Windows and Linux ( Debian, Ubuntu, Mint).

Cause for class NumberFormatter Not Found error in PHP Laravel

When trying to install a Laravel application on a Windows or Linux server, it is common to face the error “class NumberFormatter Not Found”. This happens because the php intl extension, responsible for the NumberFormatter class, is not installed or enabled on the IIS Windows or Linux Apache or Nginx server.

Troubleshooting NumberFormatter Not Found class error on Windows

To resolve class “NumberFormatter Not Found” error on Windows server, follow the steps below:

  • Locate and open the php.ini file.
  • Find and uncomment the line that contains the following statement:
extension=ext/php_intl.dll
  • Save the php.ini file and restart the web server.

When performing these steps, the application should work normally, without the error related to the NumberFormatter class.

Troubleshooting NumberFormatter Not Found class error on Linux (Debian, Ubuntu, Mint)

If you are working on a Linux server such as Debian, Ubuntu or Mint, you will need to install the php intl extension. To do this, run the following command line in a terminal:

sudo apt-get install php8.1-intl

Attention: make sure to adjust the PHP version according to the one you are using. In the example above, we used version 8.1. If using PHP 7.x or higher than 8.1, adjust the command line as needed.

After installing the extension, the application should work correctly, without the “class NumberFormatter Not Found” error.

Final considerations

By following the given instructions, you should be able to fix this issue and ensure your PHP Laravel application works properly. Remember to always check PHP versions and tweak the instructions as needed.