Preview Print Jobs (get job from server?)

Ken Tanzer ktanzer at desc.org
Mon Apr 23 19:36:30 PDT 2007


> Sorry, yes, the PHP (and Java, Python, and Perl) paths were broken.
>
> See the patch attached to STR #2342:

Thanks.  More problems, though.  I applied this patch to my fedora SRPM (cups-1.2.10-3) and rebuilt it.  My preview script was still just hanging (

D [23/Apr/2007:19:06:05 -0700] [CGI] PHP Notice:  Undefined index:  id in /usr/share/doc/cups-1.2.10/preview.php on line 19
D [23/Apr/2007:19:06:05 -0700] PID 9411 (/usr/bin/php) exited with no errors.
), so I tried a simpler script.  Details posted below, but it seems like some of the beginning output is missing.  (On a side note, are the $_REQUEST and $_GET arrays supposed to be empty?).  If I'm doing this wrong, perhaps there's a small (working) sample script you could post?

Here's my test script, invoked as:  http://localhost:631/minitest.php?foo=bar

<?php
header('Content-type: text/plain');
print("Hello there world.\n");
print_r($_SERVER);
echo("\nnote cutoff lines above\n");
echo("This time SERVER works fine: ");
print_r($_SERVER);
echo("REQUEST IS EMPTY: " );
print_r($_REQUEST);
echo("Goodbye world");
exit;
?>

And here's what I get for output (the [argc] line is the very first line of the file):

    [argc] => 2
)

note cutoff lines above
This time SERVER works fine: Array
(
    [CUPS_CACHEDIR] => /var/cache/cups
    [CUPS_DATADIR] => /usr/share/cups
    [CUPS_DOCROOT] => /usr/share/doc/cups-1.2.10
    [CUPS_FONTPATH] => /usr/share/cups/fonts
    [CUPS_REQUESTROOT] => /var/spool/cups
    [CUPS_SERVERBIN] => /usr/lib/cups
    [CUPS_SERVERROOT] => /etc/cups
    [CUPS_STATEDIR] => /var/run/cups
    [PATH] => /usr/lib/cups/filter:/usr/bin:/usr/sbin:/bin:/usr/bin
    [SERVER_ADMIN] => root at printstation.lab.connections
    [SOFTWARE] => CUPS/1.2.10
    [TMPDIR] => /var/spool/cups/tmp
    [USER] => root
    [CUPS_SERVER] => /var/run/cups/cups.sock
    [CUPS_ENCRYPTION] => IfRequested
    [IPP_PORT] => 631
    [LANG] => en_US.UTF-8
    [REDIRECT_STATUS] => 1
    [GATEWAY_INTERFACE] => CGI/1.1
    [SERVER_NAME] => localhost.localdomain
    [SERVER_PORT] => 631
    [REMOTE_ADDR] => ::1
    [REMOTE_HOST] => localhost
    [SCRIPT_NAME] => /usr/share/doc/cups-1.2.10/minitest.php
    [SCRIPT_FILENAME] => /usr/share/doc/cups-1.2.10/minitest.php
    [SERVER_PROTOCOL] => HTTP/1.1
    [HTTP_USER_AGENT] => Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.10) Gecko/20070313 Fedora/1.5.0.10-5.fc6 Firefox/1.5.0.10
    [REQUEST_METHOD] => GET
    [QUERY_STRING] => foo=bar
    [PHP_SELF] => /usr/share/doc/cups-1.2.10/minitest.php
    [PATH_TRANSLATED] => /usr/share/doc/cups-1.2.10/minitest.php
    [DOCUMENT_ROOT] =>
    [REQUEST_TIME] => 1177382062
    [argv] => Array
        (
            [0] => /usr/share/doc/cups-1.2.10/minitest.php
            [1] => foo=bar
        )

    [argc] => 2
)
REQUEST IS EMPTY: Array
(
)
Goodbye world

> > Even within /usr/share/cups, though, it seems odd to put the static
> > content in a "doc" directory.  For example, I would have expected to
> > see the images in a /usr/share/cups/images, or maybe
> > /usr/share/cups/html directory.
>
> Well, for the most part it *is* documentation - it just so happens
> that we serve it up via cupsd, too.
Hey, works for me! :)

Thanks again for your help!

Ken





More information about the cups mailing list