print to physical printer on a mac
Posted: Sun Apr 15, 2012 11:03 pm
Last week I figured out how to print to a physical printer from a PHP script on a Windows machine. This week...same question, with a Mac.
It's theoretically much simpler on a mac. The lpr command deals well with PDF files, so in theory this should work:
shell_exec('lpr ' . $filename);
But that fails (returns false). It doesn't work with a full path name, either.
Any clue? The script is able to write to the file, so those permissions are okay. Might it be a permissions problem in printing?
It's theoretically much simpler on a mac. The lpr command deals well with PDF files, so in theory this should work:
shell_exec('lpr ' . $filename);
But that fails (returns false). It doesn't work with a full path name, either.
Any clue? The script is able to write to the file, so those permissions are okay. Might it be a permissions problem in printing?