printing on IIS7
am 05.05.2009 10:52:25 von Paul Giesberts
Hi,
=A0
I have migrated a php site from Linux to windows. The only remaining =
problem seems to be=A0printing, naturally I have=A0had to change the =
code and that's where the problems have started. I have the following =
very simple code:=A0
$txt =3D "Hello World";
$handle =3D printer_open("DELL3115");
printer_write($handle, $txt);
printer_close($handle);
?>
When I run this from the command prompt using php -f ..... It works =
fine, in other words it=A0prints, when I run this script through the web =
browser then I get this:
Fatal error: Out of memory (allocated 262144) (tried to allocate =
4294967295 bytes) in C:\inetpub\wwwroot\testprn.php on line 4
I have read this article: http://support.microsoft.com/?kbid=3D184291 =
and many others, which all lead me to believe that it is an account / =
permission problem. On a side note:=A0 $handle =3D =
printer_open("non-existing-printer"); gives me a normal error in the =
sense of "can't find printer".
I run Windows 2008 64 bit, IIS7, php 5.2 32 bit ( I have enabled 32 bit =
apps in IIS and the rest of the site works fine), using FastCGI.
Has anyone got any ideas?
Thanks,=20
Paul Giesberts
IT & QA Manager
------------------------------------------------------------ -
Servicecare
Manchester Road
Oldham
OL9 7AA
------------------------------------------------------------ -
DDI: ++44-161-6881985
Tel: ++44-161-6881999
Fax: ++44-161-6881998
email: p.giesberts@servicecare.co.uk=20
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
RE: {** SPAM **} Re: [PHP-WIN] printing on IIS7
am 05.05.2009 12:18:22 von Paul Giesberts
Hi Jacob,
Thanks for your quick reply. I have 19 networked barcode printers, which
I like to print to using the code that I have. Changing it would be a
bit of a job. Considering that this works on a box using IIS 6, I don't
want to give up on this yet.
Thanks,
Paul Giesberts
IT & QA Manager
Servicecare
-----Original Message-----
From: Jacob Kruger [mailto:jacobk@iburst.co.za]=20
Sent: 05 May 2009 10:37
To: Paul Giesberts
Subject: {** SPAM **} Re: [PHP-WIN] printing on IIS7
Why don't you just use javascript to print the content?
Think it's something like window.print(), but not 100% sure.
Stay well
Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'
----- Original Message -----=20
From: "Paul Giesberts"
To:
Sent: Tuesday, May 05, 2009 10:52 AM
Subject: [PHP-WIN] printing on IIS7
Hi,
I have migrated a php site from Linux to windows. The only remaining
problem=20
seems to be printing, naturally I have had to change the code and that's
where the problems have started. I have the following very simple code:
$txt =3D "Hello World";
$handle =3D printer_open("DELL3115");
printer_write($handle, $txt);
printer_close($handle);
?>
When I run this from the command prompt using php -f ..... It works
fine, in=20
other words it prints, when I run this script through the web browser
then I=20
get this:
Fatal error: Out of memory (allocated 262144) (tried to allocate
4294967295=20
bytes) in C:\inetpub\wwwroot\testprn.php on line 4
I have read this article: http://support.microsoft.com/?kbid=3D184291 =
and
many=20
others, which all lead me to believe that it is an account / permission=20
problem. On a side note: $handle =3D =
printer_open("non-existing-printer");
gives me a normal error in the sense of "can't find printer".
I run Windows 2008 64 bit, IIS7, php 5.2 32 bit ( I have enabled 32 bit
apps=20
in IIS and the rest of the site works fine), using FastCGI.
Has anyone got any ideas?
Thanks,
Paul Giesberts
IT & QA Manager
------------------------------------------------------------ -
Servicecare
Manchester Road
Oldham
OL9 7AA
------------------------------------------------------------ -
DDI: ++44-161-6881985
Tel: ++44-161-6881999
Fax: ++44-161-6881998
email: p.giesberts@servicecare.co.uk
--=20
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
__________ Information from ESET NOD32 Antivirus, version of virus
signature=20
database 4052 (20090504) __________
The message was checked by ESET NOD32 Antivirus.
http://www.eset.com
__________ Information from ESET NOD32 Antivirus, version of virus
signature database 4052 (20090504) __________
The message was checked by ESET NOD32 Antivirus.
http://www.eset.com
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: printing on IIS7
am 05.05.2009 14:19:38 von James Crow
Paul,
I had a smiliar problem once where I had changed the amount of memory
from 16M to 256 (note the missing M). Check your memory setting in
php.ini. 262144 seems like 256K. I think that may be the default minimum
amount of memory for a script.
On my Linux systems there is a different php.ini for command line
versus apache instances. I don't know if Windows does the same thing.
Cheers,
James
Paul Giesberts wrote:
> Hi,
>
> I have migrated a php site from Linux to windows. The only remaining problem seems to be printing, naturally I have had to change the code and that's where the problems have started. I have the following very simple code:
>
>
>
> $txt = "Hello World";
> $handle = printer_open("DELL3115");
> printer_write($handle, $txt);
> printer_close($handle);
> ?>
>
> When I run this from the command prompt using php -f ..... It works fine, in other words it prints, when I run this script through the web browser then I get this:
>
> Fatal error: Out of memory (allocated 262144) (tried to allocate 4294967295 bytes) in C:\inetpub\wwwroot\testprn.php on line 4
>
> I have read this article: http://support.microsoft.com/?kbid=184291 and many others, which all lead me to believe that it is an account / permission problem. On a side note: $handle = printer_open("non-existing-printer"); gives me a normal error in the sense of "can't find printer".
>
> I run Windows 2008 64 bit, IIS7, php 5.2 32 bit ( I have enabled 32 bit apps in IIS and the rest of the site works fine), using FastCGI.
> Has anyone got any ideas?
>
> Thanks,
> Paul Giesberts
> IT & QA Manager
> ------------------------------------------------------------ -
> Servicecare
> Manchester Road
> Oldham
> OL9 7AA
> ------------------------------------------------------------ -
> DDI: ++44-161-6881985
> Tel: ++44-161-6881999
> Fax: ++44-161-6881998
> email: p.giesberts@servicecare.co.uk
>
>
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: printing on IIS7
am 05.05.2009 14:22:51 von Richard Quadling
2009/5/5 Paul Giesberts
:
> Hi,
>
> I have migrated a php site from Linux to windows. The only remaining prob=
lem seems to be printing, naturally I have had to change the code=
and that's where the problems have started. I have the following very simp=
le code:
>
>
>
> $txt =3D "Hello World";
> $handle =3D printer_open("DELL3115");
> printer_write($handle, $txt);
> printer_close($handle);
> ?>
>
> When I run this from the command prompt using php -f ..... It works fine,=
in other words it prints, when I run this script through the web brow=
ser then I get this:
>
> Fatal error: Out of memory (allocated 262144) (tried to allocate 42949672=
95 bytes) in C:\inetpub\wwwroot\testprn.php on line 4
>
> I have read this article: http://support.microsoft.com/?kbid=3D184291 and=
many others, which all lead me to believe that it is an account / permissi=
on problem. On a side note:Â $handle =3D printer_open("non-existing-pr=
inter"); gives me a normal error in the sense of "can't find printer".
>
> I run Windows 2008 64 bit, IIS7, php 5.2 32 bit ( I have enabled 32 bit a=
pps in IIS and the rest of the site works fine), using FastCGI.
> Has anyone got any ideas?
>
> Thanks,
> Paul Giesberts
> IT & QA Manager
> ------------------------------------------------------------ -
> Servicecare
> Manchester Road
> Oldham
> OL9 7AA
> ------------------------------------------------------------ -
> DDI: ++44-161-6881985
> Tel: ++44-161-6881999
> Fax: ++44-161-6881998
> email: p.giesberts@servicecare.co.uk
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Strangely enough, I've just had a very similar issue with another
application (Timeware needing to print a "Who Is In" report when the
fire alarm rings).
The issue we found was that the account being used to run the service
did not have access to the printer. In our case, Timeware didn't bomb
out, but nothing was printed.
As soon as we gave permissions to the printer for the Timeware
service, all was well.
Now with regards to IIS, I'm not too sure.
What I have half worked out ...
http://docs.php.net/manual/en/ini.core.php#ini.fastcgi.imper sonate is
required to be set to 1.
The ApplicationPool that your site(s) run under needs to be set to
something which can print.
--=20
-----
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=3DZEND002498&r=3D213474=
731
"Standing on the shoulders of some very clever giants!"
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
RE: printing on IIS7
am 05.05.2009 15:00:11 von Paul Giesberts
SGkgUmljaGFyZCwNCg0KTWFueSwgbWFueSB0aGFua3MsIHRoYXQgaGFzIGRv bmUgdGhlIHRyaWNr
LiAqKioqQlVUKioqKiBJIGhhZCB0byB0dXJuIGl0IG9mZi4gSSBoYXZlIGhh ZCB0byBzZXQgZmFz
dGNnaS5pbXBlcnNvbmF0ZT0wIHRvIGZpeCBpdCwgd2hpY2ggbWFrZXMgc2Vu c2UgaW4gYSB3YXkg
YmVjYXVzZSB0aGUgdXNlciB1bmRlci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RoZSBhY2NvdW50IGJlaW5nIHVzZWQgdG8gcnVuIHRoZSBzZXJ2aWNl IGRpZCBub3QgaGF2
ZSBhY2Nlc3MgdG8gdGhlIHByaW50ZXIuIEluIG91ciBjYXNlLCBUaW1ld2Fy ZSBkaWRuJ3QgYm9t
YiBvdXQsIGJ1dCBub3RoaW5nIHdhcyBwcmludGVkLg0KDQpBcyBzb29uIGFz IHdlIGdhdmUgcGVy
bWlzc2lvbnMgdG8gdGhlIHByaW50ZXIgZm9yIHRoZSBUaW1ld2FyZSBzZXJ2 aWNlLCBhbGwgd2Fz
IHdlbGwuDQoNCg0KTm93IHdpdGggcmVnYXJkcyB0byBJSVMsIEknbSBub3Qg dG9vIHN1cmUuDQoN
CldoYXQgSSBoYXZlIGhhbGYgd29ya2VkIG91dCAuLi4NCg0KaHR0cDovL2Rv Y3MucGhwLm5ldC9t
YW51YWwvZW4vaW5pLmNvcmUucGhwI2luaS5mYXN0Y2dpLmltcGVyc29uYXRl IGlzIHJlcXVpcmVk
IHRvIGJlIHNldCB0byAxLg0KDQpUaGUgQXBwbGljYXRpb25Qb29sIHRoYXQg eW91ciBzaXRlKHMp
IHJ1biB1bmRlciBuZWVkcyB0byBiZSBzZXQgdG8gc29tZXRoaW5nIHdoaWNo IGNhbiBwcmludC4N
Cg0KDQoNCi0tDQotLS0tLQ0KUmljaGFyZCBRdWFkbGluZw0KWmVuZCBDZXJ0 aWZpZWQgRW5naW5l
ZXIgOiBodHRwOi8vemVuZC5jb20vemNlLnBocD9jPVpFTkQwMDI0OTgmcj0y MTM0NzQ3MzENCiJT
dGFuZGluZyBvbiB0aGUgc2hvdWxkZXJzIG9mIHNvbWUgdmVyeSBjbGV2ZXIg Z2lhbnRzISINCg==
RE: printing on IIS7
am 05.05.2009 15:05:17 von Paul Giesberts
Hi James,
That did not work for me. Thanks for your quick reply though. The
solution for me was fastcgi.impersonate =3D 0. Thanks to Richard.
Regards,
Paul Giesberts
IT & QA Manager
Servicecare
-----Original Message-----
From: James Crow [mailto:james@ultratans.com]=20
Sent: 05 May 2009 13:20
To: Paul Giesberts
Cc: php-windows@lists.php.net
Subject: Re: [PHP-WIN] printing on IIS7
Paul,
I had a smiliar problem once where I had changed the amount of memory
from 16M to 256 (note the missing M). Check your memory setting in
php.ini. 262144 seems like 256K. I think that may be the default minimum
amount of memory for a script.
On my Linux systems there is a different php.ini for command line
versus apache instances. I don't know if Windows does the same thing.
Cheers,
James
Paul Giesberts wrote:
> Hi,
> =20
> I have migrated a php site from Linux to windows. The only remaining
problem seems to be printing, naturally I have had to change the code
and that's where the problems have started. I have the following very
simple code:=20
>
>
> =20
> $txt =3D "Hello World";
> $handle =3D printer_open("DELL3115");
> printer_write($handle, $txt);
> printer_close($handle);
> ?>
>
> When I run this from the command prompt using php -f ..... It works
fine, in other words it prints, when I run this script through the web
browser then I get this:
>
> Fatal error: Out of memory (allocated 262144) (tried to allocate=20
> 4294967295 bytes) in C:\inetpub\wwwroot\testprn.php on line 4
>
> I have read this article: http://support.microsoft.com/?kbid=3D184291
and many others, which all lead me to believe that it is an account /
permission problem. On a side note: $handle =3D
printer_open("non-existing-printer"); gives me a normal error in the
sense of "can't find printer".
>
> I run Windows 2008 64 bit, IIS7, php 5.2 32 bit ( I have enabled 32
bit apps in IIS and the rest of the site works fine), using FastCGI.
> Has anyone got any ideas?
>
> Thanks,
> Paul Giesberts
> IT & QA Manager
> ------------------------------------------------------------ -
> Servicecare
> Manchester Road
> Oldham
> OL9 7AA
> ------------------------------------------------------------ -
> DDI: ++44-161-6881985
> Tel: ++44-161-6881999
> Fax: ++44-161-6881998
> email: p.giesberts@servicecare.co.uk
>
> =20
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php