phpprintipp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Phpprintipp] Request for help when using PHP Print IPP!


From: Thomas HARDING
Subject: Re: [Phpprintipp] Request for help when using PHP Print IPP!
Date: Fri, 11 Apr 2014 18:46:20 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20131103 Icedove/17.0.10

On 11/04/2014 11:21, InforDB Development wrote:
My name is Ton Scheres and I'm trying to use PHP Print IPP in my project.
Greetings :)
I have a print server which I can connect and print to from my desktop computer from each IP I want. I also can connect to the web-interface of the print server using http://xxx.xxx.xxx.xxx:631. When I print to the connected printer from my desktop I can simply print to that IP-address. I used your class, but i don't know what parameters I have to fill in as setHost and setPrinterURI. I try to print from shared webhosting, so I cannot use one of the other installations.
The script I use is:


"Connection timed out" means there were no way to open any connection ("in time").

Beware: with IPP2.x (I don't handle), server IP can change unexpetedely (clients setup done by "zeroconf" or smth like) => you need to setup a dhcp manual allocation (eg: on ISP box)

You'll get the printer uri (and a convenient network test php<->ipp server) by pointing a web browser, then browse *from your http server* *to your ipp server http//[ip server]:631 * (with a tui browser on web server, such as with "lynx" or "links").

If you use an hosted server on Internet (shared), possibly not all ports are available from "server as client", also some php functions will likely be unavailable (tip: rent for a complete vm).

Also, a simple way is to write a test case with "fsockopen()", "fread()" and "fwrite()" , which are the used function regarding network.

I /maybe/ will take a look one day to stream_socket_client() (CURL cannot be used regarding the job to do with IPP).


Beware : that php class handles only IPP/1.1 (for ipp 2.x, just take a look on the complete mess at printer working group site (pwg.org))

Also: tls upgrade is not handled by that class.

(continue below)
<?php

    require_once("PrintIPP.php");

    $ipp = new PrintIPP();

$ipp->setHost("xxx.xxx.xxx.xxx"); // the outside IP address of the router which forwards port 631 to the correct printer)

If you mean your http server is outside from your network /and/ ipp server is inside (port forwarded to it), this seems ok (if the PF routing done statefull and PCB large enough : an ISP "box" can sometimes handle at most 10 incoming connections).

I know f...n ISP's who blocks some incoming ports (especially 25)



$ipp->setPrinterURI("???"); // I tried everything, but I don't know the PrinterURI ??
    $ipp->setMimeMediaType("text/plain");
    $ipp->setData("test..."); // Path to file.
    $ipp->printJob();

?>

The response my browser returns is this:


*Warning*: Invalid argument supplied for foreach() in */home/XXX/domains/XXX.com/public_html/printipp/http_class.php* on line *317*

there is a pb with debug_backtrace(), however I can't remain in as function or other nasty changing thing (this affects only error messages formatting)

*Warning*: \nE_USER_WARNING: [errno: ]: Unable to connect to "tcp://XXX.XXX.XXX.XXX port 631": Connection timed out in */home/XXX/domains/XXX.com/public_html/printipp/http_class.php* on line *329*


There is a routing problem, /or/ your IPP server dosen't listen on tcp/631

Please check up with a simple web browser from your client (or server) (pointing to http://xxx.xxx.xxx.xxx:631)

*Warning*: No Response From Server in */home/XXX/domains/XXX.com/public_html/printipp/BasicIPP.php* on line *1218*

Can you please help me with this, so I can use IPP printing??

Many thanks in advance!!!

Yours sincerely,

*Ton Scheres*
E address@hidden <mailto:address@hidden> | T (+31) (0)6 212 00 828
Best Regards,
Thomas HARDING



reply via email to

[Prev in Thread] Current Thread [Next in Thread]