How to a Print to a Local or Network Printer with PHP and Linux Command Line

//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