twilliamsen wrote:Couple things to check
1.Are you sure the printer is being shared?
2. If so, is INET_USR added to the users of the printer?
3. Make sure the printer can print from everyone including anonymous users
I have windows xp home on the client pc.
So I have no Protections to be set on the printer... maybe is this the issue?
Thank you twilliamsen for your interest.
I have this additional info:
- I wrote a test script. It is PRINT4.PHP
- I've copied it into c:\tmp folder
- I've opened a cdm (terminal) and I've run this command c:\programs\php\php.exe c:\tmp\print4.php
- well... the printer prints correctly
In the print4.php script, the printer handle points to the shared printer
Now I knew (reading aroud) about the php issue/bug that prints on shared printers don't work from a web version of a script.
One MAN ( Richard Theobald ) kindly tip me this
Richard wrote:
You will see a directory called "CLI" under your PHP installation directory. CLI stands for "Command Line Interface". In this directory is another PHP.EXE program. You can use this program to run a php script from the command prompt (eg: "php testscript.php"). Using this version of PHP I got printing to work to a shared printer on another computer. I don't know why this one worked and the web version didn't.
and in fact that works fine...
Now... why it doesn't work with shell_exec !??!!?
I tried with shell_exec I tried with redmon too... nothing, you always get this:
PHP Warning: printer_write(): couldn't allocate the printerjob [5] in c:\tmp\stampa4.php on line 24
PHP Warning: printer_write(): couldn't allocate the printerjob [5] in c:\tmp\stampa4.php on line 37
PHP Warning: printer_write(): couldn't allocate the printerjob [5] in c:\tmp\stampa4.php on line 38
PHP Warning:.............
This makes me crazy... 😕 😕 :mad: :mad:
I'll try with XP Pro, 'cause I suspected something about users permissions... In fact running the above command is as user Robert (me... cheers :-)) ) and when run by shell_exec maybe gives a different result... RedMon runs it as SYSTEM user.
Thank you for any tip.
Robert