mike42 / escpos-php

PHP library for printing to ESC/POS-compatible thermal and impact printers
Other
2.58k stars 863 forks source link

Fatal error: Uncaught Error: Class 'IntlBreakIterator' not found #824

Closed frandachi closed 4 years ago

frandachi commented 5 years ago

hallo brother, I'm new to this proyect esc/post printer, i have this problem, please give me a solution..

Fatal error: Uncaught Error: Class 'IntlBreakIterator' not found in D:\xampp\htdocs\cetak\src\Mike42\Escpos\CodePage.php:189 Stack trace: #0 D:\xampp\htdocs\cetak\src\Mike42\Escpos\CodePage.php(74): Mike42\Escpos\CodePage::encodingArrayFromData(Array) #1 D:\xampp\htdocs\cetak\src\Mike42\Escpos\CapabilityProfile.php(132): Mike42\Escpos\CodePage->construct('TCVN-3-1', Array) #2 D:\xampp\htdocs\cetak\src\Mike42\Escpos\CapabilityProfile.php(291): Mike42\Escpos\CapabilityProfile->construct('default', Array) #3 D:\xampp\htdocs\cetak\src\Mike42\Escpos\Printer.php(367): Mike42\Escpos\CapabilityProfile::load('default') #4 D:\xampp\htdocs\cetak\print.php(14): Mike42\Escpos\Printer->__construct(Object(Mike42\Escpos\PrintConnectors\WindowsPrintConnector)) #5 {main} thrown in D:\xampp\htdocs\cetak\src\Mike42\Escpos\CodePage.php on line 189

how i can fix?

mike42 commented 5 years ago

It looks like you are missing the php-intl extension.

There is some information in the README (link) which covers dependencies, as well as the supported install process - eg. I would have expected composer to complain about the missing extension.

Would you mind sharing your PHP/XAMPP version, and how you installed escpos-php?

bringar commented 5 years ago

i too have this problem, only with web activity, command-line works flawlessly and issues no errors or warnings. php-intl is installed correctly on debian buster php is 7.3

bringar commented 5 years ago

Ok, so I had two versions of php installed, cli was using 7.3 and web was using 7.0...doh!

LoverBotLab commented 5 years ago

i'm having same issue, InvalidArgumentException.php file is missing in Mike42\Escpos folder

lesmesleiton commented 4 years ago

hi, i am trying to use this library with laravel 5.8 but was not posible i got this error "Class 'IntlBreakIterator' not found" but i have already installed and configured INTL in php.ini. I am probed in php without problems works fine but with Laravel is not posible. thanks a lot.

lesmesleiton commented 4 years ago

hi, i am trying to use this library with laravel 5.8 but was not posible i got this error "Class 'IntlBreakIterator' not found" but i have already installed and configured INTL in php.ini. I am probed in php without problems works fine but with Laravel is not posible. thanks a lot.

i found the solution after 3 days with the problem in Laravel 5.8 you need install with composer with this command "composer require mike42/escpos-php" after installed you need to delete the src folder and copy the src folder with this functional example: "https://github.com/parzibyte/imprimir_ticket_php" i solved the problem. The actual code does not work in Laravel something is wrong.

mike42 commented 4 years ago

@lesmesleiton - It looks like you are using some unofficially-sourced version 2 code. The suggested install process if you really want an older version would be:

composer require mike42/escpos-php:2.2

As above, 'IntlBreakIterator' not found is likely to mean that the intl extension is not available in you runtime. You can check your runtime information using phpinfo().

To use version 3, your PHP runtime must be version 7.0 or later, and the intl, zlib and json extensions must be available. The requirements and supported install process are documented here.

dpkthapa commented 4 years ago

HI Iam facing the same problem. Iam using Ampps. Php 7.3 . Uncommented extension=php_intl.dll in php.ini. php_intl.dll file is also there. Restarted IIS. Checked everything. But the error is not going.

rosarose0413 commented 4 years ago

hi, I have also this problem:

Message: Class 'IntlBreakIterator' not found

In my local copy the library is working well but when I installed it in Ubuntu server I got the error. I already check the intl extension, it is already loaded.

What would be the problem? Can you help me fix the problem.

I'm using php7.4. Ubuntu 18.04

Thanks

ghost commented 3 years ago

Hi, "Fatal error: Uncaught Error: Class 'IntlBreakIterator' not found"

Please your help with some help on this error. In previous versions it works without problems. But that is not the way.

I'm using

Regards Mauro

philipperouchaud commented 2 years ago

I resolved this problem, on Linux, searching intl.ini both in terminal (with php --ini command) and in phpinfo in a browser. It appears that, using sudo apt install php7.4-intl, /etc/php/7.4/cli/conf.d/20-intl.ini was in the terminal list but not any intl.ini was in phpinfo. I had to execute a sudo phpenmod intl and a sudo service apache2 restart to solve this problem.

Jibaru commented 2 years ago

sudo apt install php7.4-intl

This works for me. Thanks!