Likes Likes:  0
Resultaten 1 tot 6 van de 6
Geen
  1. #1
    Marc Beckers
    PHP-CLI: printjob-problem
    Gast
    n/a Berichten
    Berichten zijn liked



    Thread Starter

    PHP-CLI: printjob-problem

    Hi,

    I get this error:

    PHP Warning: couldn't allocate the printjob [1804] in
    L:\php\scripts\script.php on line 37

    Who can help me? BTW where can I find the errorcodes and their meaning?

    This is my code which is a php-cli script:

    <?php

    $fp_log = fopen("logbestand.log", "w");

    ....
    .... <cut>
    ....

    if($gevonden === "JA")
    {
    unlink($bestand);
    //logging
    fwrite($fp_log, "blablabla");
    }
    elseif(file_exists($bestand))
    {
    $handle = printer_open("\\\\10.1.1.2\Xerox1632");
    printer_set_option($handle, PRINTER_MODE, "RAW");
    printer_start_doc($handle, "document1");
    $text = "blablabla";
    printer_write($handle, $text);
    printer_end_doc($handle);
    printer_close($handle);
    //logging
    fwrite($fp_log, "blablabla");
    }
    else
    {
    //logging
    fwrite($fp_log, "blablabla");
    }

    fclose($fp_log);

    ?>

    line 37: printer_write($handle, $text);



  2. #2
    Cyrel Janez
    PHP-CLI: printjob-problem
    Gast
    n/a Berichten
    Berichten zijn liked



    Thread Starter

    Re: PHP-CLI: printjob-problem


    "Marc Beckers" <marc@competent.nl> wrote in message
    news:3f1655e9$0$13800$19deed1b@news.inter.NL.net.. .
    > Hi,
    >
    > I get this error:
    >
    > PHP Warning: couldn't allocate the printjob [1804] in
    > L:\php\scripts\script.php on line 37
    >
    > Who can help me? BTW where can I find the errorcodes and their meaning?
    >
    > This is my code which is a php-cli script:
    >
    > <?php
    >
    > $fp_log = fopen("logbestand.log", "w");
    >
    > ...
    > ... <cut>
    > ...
    >
    > if($gevonden === "JA")
    > {
    > unlink($bestand);
    > //logging
    > fwrite($fp_log, "blablabla");
    > }
    > elseif(file_exists($bestand))
    > {
    > $handle = printer_open("\\\\10.1.1.2\Xerox1632");
    > printer_set_option($handle, PRINTER_MODE, "RAW");
    > printer_start_doc($handle, "document1");
    > $text = "blablabla";
    > printer_write($handle, $text);
    > printer_end_doc($handle);
    > printer_close($handle);
    > //logging
    > fwrite($fp_log, "blablabla");
    > }
    > else
    > {
    > //logging
    > fwrite($fp_log, "blablabla");
    > }
    >
    > fclose($fp_log);
    >
    > ?>
    >
    > line 37: printer_write($handle, $text);


    Well, do you have access to the printer, maybe apache is running under
    another user that doesn't have access to the printer.

    --
    Cyrel Janez
    cyrel@unseen.nl



  3. #3
    Marc Beckers
    PHP-CLI: printjob-problem
    Gast
    n/a Berichten
    Berichten zijn liked



    Thread Starter

    Re: PHP-CLI: printjob-problem


    "Cyrel Janez" <cyrel@unseen.nl> schreef in bericht
    news:3f16731f$0$49107$e4fe514c@news.xs4all.nl...

    > Well, do you have access to the printer, maybe apache is running under
    > another user that doesn't have access to the printer.
    >
    > --
    > Cyrel Janez
    > cyrel@unseen.nl
    >
    >


    Yes, I have access to this printer and I don't use apache for this script,
    because I run it in Command Line mode.



  4. #4
    Bob Brown
    PHP-CLI: printjob-problem
    Gast
    n/a Berichten
    Berichten zijn liked



    Thread Starter

    Re: PHP-CLI: printjob-problem

    Hi Marc,

    Are you missing a backslash in your printer URL?
    printer_open("\\\\10.1.1.2\Xerox1632"); instead of
    printer_open("\\\\10.1.1.2\\Xerox1632");

    Cheers,

    - Bob -

    "Marc Beckers" <marc@competent.nl> wrote in message
    news:3f1655e9$0$13800$19deed1b@news.inter.NL.net.. .
    > Hi,
    >
    > I get this error:
    >
    > PHP Warning: couldn't allocate the printjob [1804] in
    > L:\php\scripts\script.php on line 37




  5. #5
    Marc Beckers
    PHP-CLI: printjob-problem
    Gast
    n/a Berichten
    Berichten zijn liked



    Thread Starter

    Re: PHP-CLI: printjob-problem


    "Bob Brown" <autoreply@guru.net.nz> schreef in bericht
    newssvRa.271$aa.28692@newsfep2-gui.server.ntli.net...
    > Hi Marc,
    >
    > Are you missing a backslash in your printer URL?
    > printer_open("\\\\10.1.1.2\Xerox1632"); instead of
    > printer_open("\\\\10.1.1.2\\Xerox1632");
    >
    > Cheers,
    >
    > - Bob -


    Well, I miss that backslash, but in an other script, which is working
    properly I also miss it. And when I add the backslash it doesn't work
    either.



  6. #6
    RF Emmerink
    PHP-CLI: printjob-problem
    Gast
    n/a Berichten
    Berichten zijn liked



    Thread Starter

    Re: PHP-CLI: printjob-problem

    Marc Beckers wrote:

    > Hi,
    >
    > I get this error:
    >
    > PHP Warning: couldn't allocate the printjob [1804] in
    > L:\php\scripts\script.php on line 37
    >
    > Who can help me? BTW where can I find the errorcodes and their meaning?
    >
    > This is my code which is a php-cli script:
    >
    > <?php
    >
    > $fp_log = fopen("logbestand.log", "w");
    >
    > ...
    > ... <cut>
    > ...
    >
    > if($gevonden === "JA")
    > {
    > unlink($bestand);
    > //logging
    > fwrite($fp_log, "blablabla");
    > }
    > elseif(file_exists($bestand))
    > {
    > $handle = printer_open("\\\\10.1.1.2\Xerox1632");
    > printer_set_option($handle, PRINTER_MODE, "RAW");
    > printer_start_doc($handle, "document1");
    > $text = "blablabla";
    > printer_write($handle, $text);
    > printer_end_doc($handle);
    > printer_close($handle);
    > //logging
    > fwrite($fp_log, "blablabla");
    > }
    > else
    > {
    > //logging
    > fwrite($fp_log, "blablabla");
    > }
    >
    > fclose($fp_log);
    >
    > ?>
    >
    > line 37: printer_write($handle, $text);


    === "JA"?



Webhostingtalk.nl

Contact

  • Rokin 113-115
  • 1012 KP, Amsterdam
  • Nederland
  • Contact
© Copyright 2001-2026 Webhostingtalk.nl.
Web Statistics