Re: How to print directly from PHP code using CUPS?
In article <cefe80e1.04112 01259.3b1a5b0@p osting.google.c om>, hercos@bluebott le.com (Eduardo Hercos Rodrigues) wrote:
[color=blue]
> How to print directly from PHP code using CUPS?[/color]
This is asked frequently mostly by those who don't understand the
client/server nature of php. php runs on the server, not the client.
If cups is running on your client system, php can't do anything with it
but present output via a client (browser et al). Javascript can do
printing if your client supports it.
--
DeeDee, don't press that button! DeeDee! NO! Dee...
Re: How to print directly from PHP code using CUPS?
"Michael Vilain <vilain@spamcop .net>" wrote:[color=blue]
> This is asked frequently mostly by those who don't understand the
> client/server nature of php. php runs on the server, not the client.[/color]
Believe it or not, servers can have printers too! This can be for a
variety of reasons but most likely transaction related.
[color=blue]
> In article <cefe80e1.04112 01259.3b1a5b0@p osting.google.c om>,
> hercos@bluebott le.com (Eduardo Hercos Rodrigues) wrote:
>
>[color=green]
>>How to print directly from PHP code using CUPS?[/color][/color]
Since you're on UNIX, output the file into a temporary directory to be
printed. Depending on what type of file it is will determine how you
print it but something like exec('lpr /tmpdir/'.$filename.'.t mp') should
do the trick. Using the right command line tools or pipe, you should be
able to print what ever you need using this trick.
Re: How to print directly from PHP code using CUPS?
Kevin Bowling <kevin.bowlingN O.SPAM@wans.rem ovethis.net> wrote in message news:<NBaod.187 33$233.2872@oke pread05>...[color=blue]
> "Michael Vilain <vilain@spamcop .net>" wrote:[color=green]
> > This is asked frequently mostly by those who don't understand the
> > client/server nature of php. php runs on the server, not the client.[/color]
>
> Believe it or not, servers can have printers too! This can be for a
> variety of reasons but most likely transaction related.
>[color=green]
> > In article <cefe80e1.04112 01259.3b1a5b0@p osting.google.c om>,
> > hercos@bluebott le.com (Eduardo Hercos Rodrigues) wrote:
> >
> >[color=darkred]
> >>How to print directly from PHP code using CUPS?[/color][/color]
> Since you're on UNIX, output the file into a temporary directory to be
> printed. Depending on what type of file it is will determine how you
> print it but something like exec('lpr /tmpdir/'.$filename.'.t mp') should
> do the trick. Using the right command line tools or pipe, you should be
> able to print what ever you need using this trick.[/color]
We are talking about a shell script, yes? Can an Apache module cause
it's server to print? I'm assuming that to do so PHP would have to run
as a user with some permissions, and often for security reasons
people set up Apache such that PHP is running with a minimum of
permissions.
Comment