-1

I want to install composer, and use the printer_open / php_printer feature with the aim of printing invoices without preview (direct printing) using PHP 8 (Xampp).

But when installing composer there is a problem :

A setting in your php.ini could be causing the problem: Either the 'extension_dir' value is incorrect or a dll does not exist.

Program Output :

PHP Warning: PHP Startup: Unable to load dynamic library 'php_printer.dll' (tried: C:\xampp\php\ext\php_printer.dll (%1 is not a valid Win32 application), C:\xampp\php\ext\php_php_printer.dll.dll (The specified module could not be found))

https://i.stack.imgur.com/Z1a0K.png

After that I checked the php_printer.dll file is already available at C:\xampp\php\ext.

https://i.stack.imgur.com/QY0Su.png

But when I look at the php info, the printing feature is not available. php_printer extension on this php.ini is also already active.

https://i.stack.imgur.com/NWPru.png

So what process I haven't done yet, does php_printer really not work on php 8 ?

If it really doesn't work, is there any other solution,,

Answers on other questions haven't been able to provide a solution for me, because what I want to use is PHP version 8 (Xampp) :

Call to undefined function printer_open()

PHP 7.1.1 - All printer functions not working

Usaha
  • 1
  • 3

1 Answers1

-1

Try removing ".dll" from "php_printer.dll"-line in the php.ini file.

Haugli92
  • 1
  • 2
  • removing ".dll" from "php_printer.dll"-line in the php.ini file still not working – Usaha Mar 16 '22 at 07:12
  • 1
    Please add some explanation to your answer such that others can learn from it – Nico Haase Mar 16 '22 at 08:04
  • When looking at the error it has two possible errors. 1. Composer cant find a valid Win32 application for this php_printer.dll 2. When composer trying to find the extension it looking for php_printer.dll.dll Which means when it look for extensions in the ext folder it should be added like this: extension=php_printer And the other problem can cause from a Win64 compiled .dll file. – Haugli92 Mar 16 '22 at 09:43