Printing receipts to thermal printer

I need to be able to print receipts from my self-made shopping cart to an Epson T20 thermal printer. Nothing fancy. Don’t need to control cash drawer or anything else. Just print the receipt text and cut the paper.

I have so far failed to get php_printer properly installed on my Win7 PHP 5.4.16 development system. I tried several different versions, It is in my extension directory, and I added it in php.ini.

Before I continue to try to get php_printer to work, is this actually the solution others use? I discovered jzebra, but it seems like overkill for my needs. For one thing, the printer will always be a T20, so we don’t need a process to identify and configure printers.

Although my development environment is Windows, the solution must also work from the remote LAMP environment, as long as the user has the T20 printer attached.

Sorry, but this right here is impossible to do in just PHP. PHP runs on the server (in this case, the remote LAMP environment), and therefore has precisely zero access to hardware connected to your users’ client computers.

Given the nature of what you’re trying to do, I suggest you instead look into creating a Java applet for your hardware interaction; the company I work for produces a point-of-sale solution written in PHP, and while the printers we support are all handled by directly writing commands to the COM port (so there’s your answer re: library – we don’t use any library, just fwrite() calls on the COM port itself), we have begun using Java applets for other hardware (e.g. a biometric fingerprint scanner, and two separate credit card readers), which is the solution we’re heading toward as we begin to migrate our software from a local install to a cloud-based software-as-a-service service.