To "statline" below:
Please read http://php.net/printer regarding the printer package _not_ being a part of PHP but a PECL extension and only working in a Windows environment.
You need to download and install the php_printer.dll!
(PECL printer SVN)
printer_write — Write data to the printer
content directly to the printer.
printer_handlemust be a valid printer handle.
The data to be written.
TRUE on success or
FALSE on failure.
Example #1 printer_write() example
$handle = printer_open();
printer_write($handle, "Text to print");
couldn't allocate the printerjob  - error on windows 2000
I was printing in several places in one module, and kept getting this error after just two printer_write()'s. It was solved by printing everything into a buffer first, then calling printer_write() just once.
$_SESSION['PrintBuffer']=''; //printer buffer
$handle=printer_open("EPSON TM-T88III Receipt");
printer_set_option($handle, PRINTER_MODE, "RAW");
//print $_SESSION['PrintBuffer']; //for testing