[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pear-dev
Subject:    [PEAR-DEV] #26346 [Com]: Cannot output to a shared printer
From:       "liviu dot dospinescu at rdslink dot ro" <pear-dev () lists ! php ! net>
Date:       2004-09-24 4:44:57
Message-ID: 200409240444.i8O4ivSW008735 () ez1 ! php ! net
[Download RAW message or body]

 ID:               26346
 Comment by:       liviu dot dospinescu at rdslink dot ro
 Reported By:      rich at dwell dot co dot uk
 Status:           Open
 Bug Type:         PECL related
 Operating System: Windows 2003
 PHP Version:      4.3.4
 New Comment:

There is a problem with php_printer.dll

I have made all the changes in php.ini, but launching Winows XP, there
is a "WARNING" mesaj like this:
"Unknown(): Unable to load dynamic library 'C:\php\extensions'(the
location of library)  - The specific module could not be found"!
Please, help me!!
I am working under Windows XP Prof. with php4.3.8.


Previous Comments:
------------------------------------------------------------------------

[2004-07-23 18:11:18] pete at downplay dot co dot uk

I have a slightly different problem (although I am able to recreate the
problem you have).

PHP/Apache/MySQL is running on a Win2003 server computer. The label
printer is running on an XP machine on the network. I have installed
the drivers locally on the Apache machine, so Windows should handle the
network communication. When I print the document from PHP as follows : 

	printer_start_doc($print); 
	printer_start_page($print); 

	$font =
printer_create_font("Tahoma",($h*0.6),($h*0.6*0.8),400,false,false,false,0);

	printer_select_font($print, $font); 
	printer_draw_text($print, $pname, 0, $h*0.5);
	printer_draw_text($print, $punits, 0, $h*1.25);
	printer_draw_text($print, $ser, 0, $h*2);
	printer_delete_font($font); 

	printer_end_page($print); 
	printer_end_doc($print); 

The document goes to the printer queue, but does not print. Instead the
Status column changes from "Printing" to "Printing - Error" and gives me
no further indication as to what the problem with. I have tried printing
from Notepad on the Apache server, and it prints fine. I've also tried
printing to a different printer in PHP, and the same error happens.

I am guessing that php_printer.dll is incompatible with Win 2003. I've
tried the solution suggested by basurto at canada dot com, and it made
no difference. The second parameter appears in the Document Name column
of the print queue with no problems in any case.

If anyone has a fix or workaround, I would be most grateful!

------------------------------------------------------------------------

[2004-04-04 17:12:30] jasonm at reslife dot org

Don't know if it's a "bug" however....

I have been hearing a lot of talk about people not being able to print
to a shared printer with the php_printer.dll extension and functions. I
have been doing this for over a year with our churches WAMP checkin
system I wrote.  

Everything works fine as long as you are in windows 2000.  When you get
to XP, you MUST belong to a domain and the WAMP box MUST be on the
domain in order for things to work; therefore you must have some sort
of in house domain controller.  Also, all of the drivers for any shared
printers MUST be on the WAMP box shared with the same name as the
others.

I have deduced that the php_printer.dll relies upon the WAMP box's
Print Spooler; shut it down and no printing happens.

With all that said, I must admit our configuration (Windows 2000 Pro,
Apache 1.3.27, PHP 4.3.4, MySQL 4.0.13-nt) does seem to crash every
Sunday (when there are about 17+ stations running the checkin system
and printing; we check in over 800+ unique children in over 4
services).

Could it be that we need to move to Windows 2000 Server Installation?
All of the errors/crashes seem to point to a spooler overload (we could
potentially have over 10 print jobs being called at any one time..maybe
Win2k Pro limit of 10 connections is causing this?)....

Any help or info would be greatly apprecited.  Thanks!
-j

------------------------------------------------------------------------

[2004-02-06 18:29:51] basurto at canada dot com

Work around:
------------
I was having the same problem I solve this problem with the following
steps:
1. I add Novell client
2. Start nprinter in the machine that have the printer
3. Next I did not add the second parameter It looks like 
your code>>>printer_start_doc($handle, "");
my   code>>>printer_start_doc($handle);
4. voila it works!!
NOTE:
-----
I already have Novell but if you don't have it you can test this in a
share printer with Microsoft.
I think there is a problem with the second parameter in a network
printer.


I hope this help you.
Regards

------------------------------------------------------------------------

[2003-11-21 05:30:21] rich at dwell dot co dot uk

Description:
------------
There is a problem with the php_printer.dll.

Printing to a local printer is fine although I find that some of the
options in printer_set_option do not seem to work.

On any share network printer, however, PHP gives warning about not
being able to allocate the print job and then terminates.

I can in some cases work around this by outputing to a file and then
calling the external program print.exe to print the file, but this is
only useful for printers with there own proprietory language like label
printers.  

Obviously this is not a rights issue as I am printing to the printer
using print.exe which runs under IUSR privileges.



Reproduce code:
---------------
<?php 

$handle = printer_open("\\\\Warehouse\\whlaser"); 
printer_start_doc($handle, ""); 
printer_start_page($handle); 

$font = printer_create_font("Arial", 100, 50, PRINTER_FW_MEDIUM, false,
false, false, 0); 
printer_select_font($handle, $font); 
printer_draw_text($handle, "PHP is simply cool", 400, 400); 
printer_delete_font($font); 



printer_end_page($handle); 

printer_end_doc($handle); 
printer_close($handle); 


?>


Expected result:
----------------
The network printer should output "PHP is simply cool" as it does on a
locally connected printer.

Actual result:
--------------
Warning: couldn't allocate new print job in
c:\inetpub\wwwroot\test\unused routines\print.php on line 4

Warning: couldn't start a new page in c:\inetpub\wwwroot\test\unused
routines\print.php on line 5

Warning: couldn't end the page in c:\inetpub\wwwroot\test\unused
routines\print.php on line 15

Fatal error: couldn't terminate print job in
c:\inetpub\wwwroot\test\unused routines\print.php on line 17



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=26346&edit=1

-- 
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic