How to a Print to a Local or Network Printer with PHP and Linux Command Line By nertbloxApril 5, 2013February 24, 2020How to, Linux, PHP //Easy way to print from php or just plain command line. exec("lpr [ options ] [ filename ... ]"); //Gettinga little Fancy cat thesis.txt | lpr //Another example exec("lpr -P printer -r filename.txt"); Read more in at this Link