Question

I need to make a print on cups printer from my PHP web application. Is there a PHP API for cups? In my server shell_exec() and all such functions are strictly disabled. So I cant print using lpr. Please advice

Was it helpful?

Solution

Now it's available. We can do it by PHP::PRINT::IPP
Sample Code

<?php require_once(PrintIPP.php); $ipp = new PrintIPP(); $ipp->setHost("localhost"); $ipp->setPrinterURI("/printers/epson"); $ipp->setData("./testfiles/test-utf8.txt"); // Path to file. $ipp->printJob(); ?>

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top